Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::unordered_map thread safety
From: Daniel Krügler (dsp_at_[hidden])
Date: 2008-11-11 04:34:15

Jonathan Franklin wrote:
> On Mon, Nov 10, 2008 at 2:43 PM, Kenny Riddile <kfriddile_at_[hidden]
> <mailto:kfriddile_at_[hidden]>> wrote:
> I could be wrong, but I don't think the standard says anything about
> the thread safety of STL containers, so it's implementation-specific.
> The standard says nothing of thread safety. However,
> <> says "Which of the functions in the C++ Standard
> Library are not reentrant subroutines is implementation-defined." So at
> least wrt reentrancy it's implementation defined.

In the context of unordered containers it seems appropriate to consider
the direction the standard is going. The most recent draft N2798 has
updated some parts of the library introduction to take care of this.

In [res.on.objects] we have:

"The behavior of a program is undefined if calls to standard library
functions from different threads may introduce a data race. The
conditions under which this may occur are specified in"

and in [] we find several added/updated
paragraphs. Please read details in:

- Daniel

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at