[python-win32] unexpected behavior for threaded Windows Service
Mark Hammond
mhammond at skippinet.com.au
Wed Sep 22 02:24:07 CEST 2004
> I'm still curious to know why
> win32event.WaitForSingleObject(...) appears to
> pause both (producer and consumer) threads rather than just
> the consumer
> thread.
I don't understand your question - both threads call WaitForSingleObject, so
both threads pause.
Your producer appears to try and sleep twice - once by virtue of calling
self.shutdown_requested() (where is pauses consumer_pause seconds, and once
via a direct call to sleep for producer_seconds. I doubt that is what you
intended.
I suggest you ignore the service part of this. I'm confident that if you
constructed the same basic code as a regular Python script, it would do the
same thing, and also make it clearer to you what the real issues are.
Mark.
More information about the Python-win32
mailing list