Search code examples
javaconcurrencythread-safetyfsmautomaton

Is the dk.brics.automaton package thread safe?


Apache Lucene uses a modified form of the Brics automaton package. But is Brics thread safe?

More specifically, can it safely handle multiple, concurrent automaton instances from different threads - without blocking?


Solution

  • Yes, constructing an Automaton or a RunAutomaton from a RegExp is thread safe - unless you use setAllowMutate.