When in doubt, use a mutex! - What kinds of global value mutation are thread-safe? Therefore, we may desire a thread-safe Python dict that is future-proof to changes to Python interpreters and the GIL. Alternate interpreters may or may not implement the same rules for atomic operations on dictionaries. It is also becoming more common to run Python code using third-party interpreters, mostly to achieve better performance. These will likely change the specifics of the Python VM, bytecode compiling and thread-safety of built-in data structures. There are frequent development efforts to improve the Python interpreter and even attempts to remove the GIL. This means that depending on the thread-safety of these operations could be fragile in future versions of Python or when executing your Python program with alternate Python interpreters.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |