Re: [pcre-dev] question about thread

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: 吴仁科
CC: pcre-dev
Subject: Re: [pcre-dev] question about thread
On Wed, 2 Mar 2011, 吴仁科 wrote:

>
> Dear PCRE developers:
>        These days i used Pcre for multiple threads designing.I created 4 threads in a 4 nuclear CPU to match Regular
>  Expression , but it couldn't raise the peed when i just created one thread.Could PCRE be used in several threads at the same time? 
>        Thank you .


This text is an extract from the "man pcreapi":

MULTITHREADING

       The PCRE functions can be used in  multi-threading  applications,  with
       the  proviso  that  the  memory  management  functions  pointed  to  by
       pcre_malloc, pcre_free, pcre_stack_malloc, and pcre_stack_free, and the
       callout function pointed to by pcre_callout, are shared by all threads.


       The  compiled form of a regular expression is not altered during match-
       ing, so the same compiled pattern can safely be used by several threads
       at once.



--
Philip Hazel