This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: libstdc was not safe in 2.92, is it now in 3.X?
- To: "Andrew B. Lundgren" <Andrew dot Lundgren at Level3 dot com>
- Subject: Re: libstdc was not safe in 2.92, is it now in 3.X?
- From: Jason Merrill <jason_merrill at redhat dot com>
- Date: 28 Aug 2001 23:17:09 +0100
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>
- References: <Pine.GSO.4.33.0108281503390.5805-100000@anaconda.vdev.level3.net>
>>>>> "Andrew" == Andrew B Lundgren <Andrew.Lundgren@Level3.com> writes:
> The FAQ points the the 11th release as the current release (or 2.92) and
> says it is not thread safe based on the following definition:
> The SGI implementation of STL is thread-safe only in the sense that
> simultaneous accesses to distinct containers are safe, and simultaneous
> read accesses to to shared containers are safe. If multiple threads
> access a single container, and at least one thread may potentially write,
> then the user is responsible for ensuring mutual exclusion between the
> threads during the container accesses.
Yes. This is by design.
> Is the rest of the library thread safe now in 3.X or does the current FAQ
> hold that it "is not appropriate for multithreaded access"? (Based on
> the SGI definition)
It is appropriate for multithreaded access, but you must control access to
the containers yourself, just as with any other shared resource. Having
the container class do it internally is too slow.
Jason