AhoCorasickDoubleArrayTrie icon indicating copy to clipboard operation
AhoCorasickDoubleArrayTrie copied to clipboard

Is parseText thread safe?

Open fabrichter opened this issue 7 years ago • 1 comments

Thanks for your great work on this project! I was wondering if the implementation is thread safe when used in a read-only fashion, i.e. I want to initalize one AhoCorasickDoubleArrayTrie, set it up via build once and then call parseText from multiple threads. Is this possible / safe to do?

fabrichter avatar Oct 25 '18 08:10 fabrichter

Yes, it's safe to call parseText from multiple threads. As this method doesn't modify any members, but put every temporary result on stack, it's thread safe.

hankcs avatar Oct 26 '18 18:10 hankcs