multithreading and shared dictionary

Istvan Albert istvan.albert at gmail.com
Fri Jul 7 17:10:47 EDT 2006


Stéphane Ninin wrote:

> Is a lock required in such a case ?

I believe that assignment is atomic and would not need a lock.

yet most of the other dictionary use cases are not threadsafe. For
example I suspect that you'd get an error if you were iterating through
the dictionary while another thread inserted a value.

i.




More information about the Python-list mailing list