-
Is it safe to call methods on the same |
Beta Was this translation helpful? Give feedback.
Answered by
pemistahl
Nov 27, 2023
Replies: 1 comment
-
Yes, it is thread-safe. Otherwise, the parallel variants of the In order to make the library thread-safe, the only thing necessary was to wrap the |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Vasniktel
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, it is thread-safe. Otherwise, the parallel variants of the
LanguageDetector
methods would not work because they do exactly that, namely sharing the same instance across multiple threads.In order to make the library thread-safe, the only thing necessary was to wrap the
HashMap
s which hold the language models inRwLock
s.