aho_corasick icon indicating copy to clipboard operation
aho_corasick copied to clipboard

Is the trie class threadsafe?

Open sbyma opened this issue 6 years ago • 4 comments

In particular, the main parse_text method. Is it safe for multiple threads to call parse_text at the same time?

sbyma avatar Jul 09 '18 10:07 sbyma

same question +1

endyul avatar Aug 31 '18 08:08 endyul

Also interested

dkurzaj avatar Nov 06 '19 18:11 dkurzaj

I am using the master branch, and i just fix one multi-thread crash bug for my usage. My usage is very simple: load the dict once and only one thread do the load work. Then multi-thread will call parse_text() and never call insert(). The bug occurs randomly when calling parse_text(), the callstack stops at construct_failure_states(). My solution is make construct_failure_states() a public member function, and call it in load dict thread after loading.

david-pureal avatar Dec 02 '19 09:12 david-pureal

construct_failure_states

the function name should be "check_construct_failure_states()"

lougxing avatar Nov 10 '20 06:11 lougxing