locks

Diez B. Roggisch deetsNOSPAM at web.de
Wed Oct 13 10:10:30 EDT 2004


> Okay, to clarify, for the most part I *was* in fact referring to "higher
> level issues".  I doubt tracebacks or mangled data would occur simply
> due to the operation's being non-atomic.  However, if you have code that
> say, checks for an item's existence in a list and then appends it if it
> isn't there, it may cause the program to fail if another thread adds
> that item between the time of the check and the time of the append.
> This is what I was referring to by potential for mangled data and/or
> tracebacks.

_That_ of course I'm very well aware of - but to my expirience, with several
dozen threads appending to one list I never encountered a interpreter
failure. That is in contrast to java, where you get an
"ConcurrentModificationException" unless you don't ask specifically for a
synchronized variant of the collection of yours.


-- 
Regards,

Diez B. Roggisch



More information about the Python-list mailing list