Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is std::regex thread safe?

Related to Is a static boost::wregex instance thread-safe? but for the standarized version. Can I call regex_search from several threads with the same regex object?

like image 610
Bruno Martinez Avatar asked Apr 01 '13 22:04

Bruno Martinez


1 Answers

While Sean's answer is true of the standard, individual implementation may fall short. VC++ 2013, at least, looks like it has race conditions in its copy constructor and in a lazily evaluated variable.

like image 124
Eclipse Avatar answered Oct 07 '22 00:10

Eclipse