From: Alexander Terekhov (terekhov_at_[hidden])
Date: 2001-08-22 06:45:40
> I'm going to try again. I have no dispute with your
> assertions. I have no dispute with the need for TLS and adoption.
> However, the need does not exist when creating a brand new
> boost supported program using the threads library.
IMHO, the need (for TLS/TSD) DOES exist even when creating
a brand new boost supported program using the threads library.
e.g. if i want to implement my own portable starvation-free
read/write lock which would support recursive read locking
(posix says: "A thread may hold multiple concurrent read
locks on rwlock (that is, successfully call the
pthread_rwlock_rdlock() function n times). If so, the
application shall ensure that the thread performs matching
unlocks (that is, it calls the pthread_rwlock_unlock()
function n times").
or if i want to implement my own "debug" locks which
would trace some thread-specific data (e.g. thread name)
on lock/unlock calls.
IMHO TSD/TLS/TSS/.. is simply a relatively inexpensive
mechanism to provide a function with some context
(thread-specific) state info w/o having to do so using
thread stack which is not free as well (especially taking
into account the cost of propagation to the next
function(s) and next function(s),...).
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk