Daniel Stutzbach wrote:
On Tue, Mar 2, 2010 at 1:58 PM, Martin P. Hellwig <martin.hell...@dcuktec.org <mailto:martin.hell...@dcuktec.org>> wrote:

    What actually happens if multiple threads at the same time, write to
    a shared dictionary (Not using the same key)?

All of Python's built-in types are thread safe.  Both updates will happen.

No need to use synchro primitives like locks?

I know that it may work, but that strikes me as somehow wrong... I'm used to using things like Lock().acquire() and Lock().release() when accessing shared data structures, whatever they are.

Although trying to do the "right thing" may indeed get one in trouble in case of deadlock caused by a bug in one's own program.

Regards,
mk


--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to