------- Comment #19 from pcarlini at suse dot de  2006-10-31 17:01 -------
Created an attachment (id=12520)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12520&action=view)
Draft patch using the _M_get_mutex idiom for _M_invalidate

This one, instead, using the _M_get_mutex idiom (similarly to pool_allocator,
for example), should be able to deal with the _M_invalidate issue too. Agreed,
in debug-mode performance isn't the main concern, still I'm a bit worried,
because we have got one single mutex for the entire STL. But I have no idea how
this problem can be solved at this stage, the ABI still frozen. Besides that
general issue, the approach should work, maybe locking is needed also for some
_Safe_sequence functions: in that case _Safe_iterator_base::_M_get_mutex would
be still usable, being public, or, to be cleaner, an _M_get_mutex method could
be added to _Safe_sequence_base too. In any case, I would rather wait for
testcases before touching _Safe_sequence...

Benjamin, what do you think?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29496

Reply via email to