-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread-safety concern related to interpolation parsing #715
Comments
Thread safety is not a current goal. |
Yeah I assumed it wasn't a top priority, but I also thought it wouldn't hurt to address this specific one. For what it's worth I ended up thinking about it because I realized my own project was multi-threaded and might run into problems because of this specific issue (although it's unlikely to happen because my reads are infrequent enough). The tricky thing is that even if it happens, I may not notice it because it might not crash (one potential side effect would be reading an incorrect config value, but in my specific use case that would essentially "just" give incorrect results). I won't push for it though if you feel like it's not worth it -- I'll probably duplicate my config instead in my project anyway just to be 100% safe :) |
We can add it. But it will be a much longer journey than this. |
General thread-safety would definitely be quite challenging. Thread-safety on concurrent reads may be a more realistic target. |
Ensure the grammar cache is thread-safe Fixes #715
Describe the bug
It occurred to me that we may want to ensure that OmegaConf is thread-safe (at least on simultaneous reads). But the cache mechanism I introduced in #445 to speed-up the parsing of interpolations is not thread-safe.
Expected behavior
Parsing interpolations in parallel from multiple threads should not fail because of the cache mentioned above.
The text was updated successfully, but these errors were encountered: