[xpressive] is regex_match threadsafe?

Hi, Is it safe to call regex_match with the same cregex|sregex object from different threads? Or should each thread use its own cregex|sregex object? TIA -- Sergey Skorokhodov

On Wed, Mar 18, 2009 at 3:25 PM, Sergey Skorokhodov
Hi,
Is it safe to call regex_match with the same cregex|sregex object from different threads? Or should each thread use its own cregex|sregex object?
TIA
-- Sergey Skorokhodov
I see in the docs that regex param is passed as a reference to the const object, therefore calling regex_match from different threads is thread safe for regex (cregex|sregex) object instances. Greetings, Ovanes

Ovanes Markarian wrote:
Sergey Skorokhodov wrote:
Is it safe to call regex_match with the same cregex|sregex object from different threads? Or should each thread use its own cregex|sregex object?
I see in the docs that regex param is passed as a reference to the const object, therefore calling regex_match from different threads is thread safe for regex (cregex|sregex) object instances.
Yes, that's correct. regex objects can be used from multiple threads. -- Eric Niebler BoostPro Computing http://www.boostpro.com

Eric Niebler wrote:
Ovanes Markarian wrote:
Sergey Skorokhodov wrote:
Is it safe to call regex_match with the same cregex|sregex object from different threads? Or should each thread use its own cregex|sregex object?
I see in the docs that regex param is passed as a reference to the const object, therefore calling regex_match from different threads is thread safe for regex (cregex|sregex) object instances.
Yes, that's correct. regex objects can be used from multiple threads.
Ovanes and Eric, thanks a lot for quick response. -- Sergey Skorokhodov
participants (3)
-
Eric Niebler
-
Ovanes Markarian
-
Sergey Skorokhodov