On Wed, Jan 26, 2005 at 08:14:36PM +0000, Ben Hutchings wrote:
That is not specifically about thread-safety in Boost.Regex; the initialisation of local static variables is generally not done in a thread-safe way even by implementations that are intended to support multithreaded programs, and this goes for variables of any type.
Hi Ben, Ok, I've now completely put both functions in a boost::mutex scoped lock and it doesn't generate any segmentation faults anymore; so basically, it works now. For some reason I have the feeling this whole problem could be solved *much* more elegant, but since I have a deadline in 1.5 weeks I think this will do for now... I have found this page explaining in detail why the initialisation is thread-unsafe, in case anyone is interrested: http://weblogs.asp.net/oldnewthing/archive/2004/03/08/85901.aspx Thanks for your help, Leon Mergen