threading.py -> winthreading.c : Call for benchmark code

Aahz Maruch aahz at panix.com
Fri Dec 21 07:19:17 CET 2001


In article <mailman.1008842012.24085.python-list at python.org>,
Jason Orendorff <jason at jorendorff.com> wrote:
>
>[Technical note:  I discovered something neat.  Everything I do,
>or check, or set, or increment in C code is protected by the global
>interpreter lock.  This eliminates a lot of the complexity of writing
>good threading code, because I don't have to worry about doing
>anything atomically!  I can avoid functions like InterlockedIncrement()
>and InterlockedExchange().  The resulting code is clearer and faster.]

Well, sort of.  Problem is, if you're not careful to release the GIL at
the right moment, you get a deadlock when you can't acquire a lock.
-- 
                      --- Aahz  <*>  (Copyright 2001 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

Tenth Virtual Anniversary: 11 days and counting



More information about the Python-list mailing list