Win32 and blocking threads

Campbell cb921 at voice.co.za
Mon Apr 23 15:23:52 EDT 2001


Hello again, inspired people,

I am attempting to control many devices, all possibly blocking forever,
each from a seperate thread.  Each thread makes a call early on, which
blocks until there is activity.  It appears that, in the process of
creating 60 threads, the entire program is blocked, including the
creation of new threads, as soon as the very first blocking call is made
by a thread.  letting this thread unblock (ie, making it block with a
timeout) allows other threads to continue after the call is finished,
but the next thread in line repeats this process.  I think I am seeing
correctly, this is what's happening.

Is this a general thread consideration I have not expected?  I did
expect to see some of those, my experience level (python/threads/win32)
is low.  I have searched for some form of a thread.yeild, but in this
blocking case I don't know if it would come to much use if I did find
it.

Are Python/win32 Threads == Windows threads?  Or are they, in the style
of ActivePerl's Threads, rather braindead?  I know this is a FAQ of
sorts but I have read that document and many others in confusion still.

It appears most of the success and example code comes from a Unix.  Any
solid win32 example code out there?  Can anyone suggest anything else?
I'm a bit lost...

Thanks
campbell




More information about the Python-list mailing list