Because of multithreading semantics, this is not reliable.

Grant Edwards grante at visi.com
Thu May 4 15:38:55 CEST 2006


On 2006-05-04, Olaf Meding <OlafMeding at noSpam.compuserve.com> wrote:

>> return result   before that line, some other thread added a value !
>
> Sure, but that is the nature of using threads and a mutex.

Yes.

> I hope you are you not saying that every function that uses a
> mutex should have a comment saying this is not "reliable"?

My point exactly.

-- 
Grant Edwards                   grante             Yow!  My pants just went to
                                  at               high school in the Carlsbad
                               visi.com            Caverns!!!



More information about the Python-list mailing list