intel / hyperscan

High-performance regular expression matching library
https://www.hyperscan.io
Other
4.78k stars 710 forks source link

Does hyperscan thread-safed? #114

Open Vincent717 opened 5 years ago

Vincent717 commented 5 years ago

Hi all, I am trying to run hyperscan on python, with multi-threading. Seems like it will throw errors like:
Fatal Python error: ceval: tstate mix-up and Fatal Python error: GC object already tracked

Does it mean that hyperscan is not thread-safed and cannot be used with multi-threading?

Thx. Vincent

xiangwang1 commented 5 years ago

Hi Vincent,

Hyperscan can be used for multi-threading cases. Each scan thread can share a common database but needs to have its own scratch space if matching in parallel. It'll be good if you can provide more details.

Thanks, Xiang