Re: Perl5Pattern
"Daniel F. Savarese" <[email protected]> Fri, 26 Sep 2003 11:30:50 -0400
| Newsgroups | gmane.comp.jakarta.oro.user |
|---|---|
| Message-ID | <[email protected]> |
In message <27347358.1064581007440.JavaMail.www@wwinf4005>, jla159753 writes: > I use oro-regexp in the servlet. > I want to know if possible to compile one time reg exp string and conserve it, > to use with PERL5Matcher several time and with several thread in same time? Just compile it, store it in a variable that's appropriately accessible, and reuse it. That's the intended usage. If you want to use it in multiple threads, compile it with the Perl5Compiler.READ_ONLY_MASK option, but make sure you use a separate Perl5Matcher instance for each thread. If you don't use a separate Perl5Matcher instance for each thread, don't bother with READ_ONLY_MASK and just protect matching attempts with critical sections (not recommended). daniel