Menu

How to use Matcher in multithreaded app?

Help
2006-02-11
2013-06-12
  • Nobody/Anonymous

    I have a trouble when try to use Matcher in multithreaded applications.
    I found the following guide from Jregex website:
    "the typical tactics in multithreaded applications is to have one Pattern instance per expression(a singleton), and one Matcher object per thread."

    Who can show me the Java code ?

     
    • David Pérez

      David Pérez - 2007-01-25

      I interpret it as Pattern objects can be static (shared between multiple threads), whereas each thread uses its own Matcher object (local variable instead of a static member).

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.