Entry
Are dictionary lookups threadsafe?
Can I lookup and retrieve an item in a dictionary while another thread is adding an item?
May 22nd, 2000 05:11
unknown unknown, Thomas Wouters
Python takes great care to make sure all builtin operations are
threadsafe, and tries to make it as easy as possible to make your own
extensions threadsafe. As long as you write Python, you're very
threadsafe, because only one thread can execute Python code. If you
start writing extentions, in C, or embedding Python in a multi-threaded
program, things get a little more complicated, though, and you'll have
to pay attention to where you allow multiple (Python) threads to
execute.