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

Ype Kingma ykingma at accessforall.nl
Thu Dec 20 13:43:30 EST 2001


Jason,

You might like this:

http://www.bagley.org/~doug/shootout/bench/prodcons/


Have fun,
Ype

P.S. In jython I would recommend:
http://g.oswego.edu/dl/classes/EDU/oswego/cs/dl/util/concurrent/intro.html


Jason Orendorff wrote:
> 
> Everyone,
> 
> I am reimplementing parts of threading.py in non-portable
> Win32-only C.  Lock and RLock are already working.  Tests show:
>   winthreading.Lock is about 25% faster than threading.Lock.
>   winthreading.RLock is about 26 times as fast as threading.Lock!
> 
> But I'm not sure these numbers translate into real-world gains.
> So: I'm looking for Python code that shows how these objects
> (Lock, RLock, Condition, Semaphore, Event) are used in the wild.
> 
> If you're interested in a 26x faster RLock, please send me
> real-world Python code that could benefit.
> 
> Thanks in advance,
> Jason Orendorff
> 
> [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.]



More information about the Python-list mailing list