Boost logo

Boost Users :

From: Roland Schwarz (roland.schwarz_at_[hidden])
Date: 2005-01-27 09:08:03


John Maddock wrote:

>
> Regex is thread safe in following sense: given a const regex object,
> you can safely share that object between multiple threads.
>
> However, your backtrace indicates that the problem occurs during regex
> construction: this is a situation *you* have to deal with (no matter
> what the data type), the thread safety guarantees only kick in once
> the object has been constructed, it's up to you to ensure that no race
> condition occurs during the construction. Your second link above
> indicates a couple of methods you could use to achieve this.
>

Sorry for jumping into this discussion, since I am not very knowledgable
in the use of the
regex library. But the buzzwords: "construction", "thread" and "local
static" alerted me.

There was a bug in the spirit library that seemingly had the same
attributes attached.

A function contained a local static object. If this is the case in regex
library too this should
be changed, since such usage is not thread safe.
If this is not the case, please simply ignore my post since it does not
apply.

Roland


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net