Menu

Is jregex thread safe?

Help
2002-06-26
2002-06-26
  • Nobody/Anonymous

    I just started to use jregex in a JSP/Servlet environment and I am wondering if any/some/all of the jregex objects are thread safe. For example can I have a global static Pattern instance and obtain and use concurrent matchers on it?

     
    • Sergey A. Samokhodkin

      > and I am wondering if any/some/all of the jregex
      > objects are thread safe.

      Thread-safe objects: Pattern, Replacer
      thread-unsafe objects: Matcher, RETokenizer

      > can I have a global static Pattern instance and
      > obtain and use concurrent matchers on it

      Yes. Moreover, this is a recommended way to do.

      Regards,
      Sergey

       

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.