Thread safety#
Most functions and classes are thread safe. Notable exceptions are documented here.
Not thread safe |
Comment |
|---|---|
This function modifies global state. |
|
When |
|
Invoked implicitly before all translation tasks. Results are cached when using a |
|
Reflects the most recent |
|
Delegates to |
|
Performs |
Transformers#
The Translator.transformers are reused for all translation tasks. Bundled Transformer types are
thread safe. Transformers are inherited by any TranslationMap instances created by the Translator,
including the Translator.cache created by Translator.go_offline(). Note that
Translator.register_transformer() mutates shared state (including the cache), so the safe-to-share guarantee
above assumes no registrations are made after going offline. See the registration window for details.
Fetchers#
Some thread-unsafe Fetcher operations emit a ConcurrentOperationWarning on a best-effort basis when
entered from multiple threads at once. This detection is cheap and lock-free, so it may miss races; absence of a warning
does not prove correctness.