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

Re: libstc++2.10-dev & threads



On Wed, 12 Jul 2000, Chris Leishman wrote:

> No. Definately not.  Like I said, I was getting SEGV during the _construction_
> of a string ON THE STACK.  So it was definately NOT shared between two
> threads.
> 
> Event the STL containers are not reentrant - they don't support simultaneous
> access to methods from different threads.

Threads shouldn't be simultaneously accessing a piece of data. That's what
mutexes are for. Just make a mutex, lock it whenever you want to work
with the container, and release it when you're done. 

=--------------------------------------------------=
Mike Kelly	<kellym@nbnet.nb.ca>
		<http://rasputin.toasty.org/~kellym>
  'Two roads diverged in a wood, and I --
   I took the one less traveled by,
   And that has made all the difference.'

		-- Robert Frost
=--------------------------------------------------=




Reply to: