------- Comment #2 from pcarlini at suse dot de 2005-10-27 10:16 ------- I can see a few possible strategies: 1- Arches supporting the new __sync_fetch_and_add (at least, i686, x86_64, powerpc ia64, s390), could simply use it on the existing __bin._M_used. 2- Otherwise, a lock in _M_reclaim_block only when __block->_M_thread_id != __thread_id. At the same time has to be changed _M_reserve_block too, however, and it's tricky to do that without locking at every single allocation: maybe, changing slightly the algorithm, an entire pool of blocks can be marked as used when obtained from operator new or the global list (at the beginning of _M_reserve_block).
-- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24469