Re: [pcre-dev] question about thread

Page principale
Supprimer ce message
Auteur: 吴仁科
Date:  
À: pcre-dev
Sujet: Re: [pcre-dev] question about thread

Is that means we couldn't use multi-threading applications to match different compiled forms at once? I mean each thread use its own compiled form which is different from others.

> Date: Wed, 2 Mar 2011 10:19:39 +0000
> From: ph10@???
> To: wrk@???
> 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