Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/lib/libpthread



Module Name:    src
Committed By:   joerg
Date:           Sun Apr 19 20:47:04 UTC 2020

Modified Files:
        src/lib/libpthread: pthread_tsd.c

Log Message:
Improve TSD behavior

Optimistically check whether the key has been used by this thread
already and avoid locking in that case. This avoids the atomic operation
in the hot path. When the value is set to non-NULL for the first time,
put the entry on the to-be-freed list and keep it their until
destruction or thread exit. Setting the key to NULL and back is common
enough and updating the list is more expensive than the extra check on
the final round.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/lib/libpthread/pthread_tsd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index