[New-bugs-announce] [issue12539] multiprocessing.Event.wait(n) doesn't time out properly

mokrates report at bugs.python.org
Tue Jul 12 01:06:22 CEST 2011

New submission from mokrates <mmolle at gmx.net>:

Following is my problem:
I have two processes, connected via multiprocessing.Event
The one waits for the other with .wait(300). After 300 seconds it should look if there's work, even if it has not been awoken by the other process.
So. This runs on my Laptop, and when I fold it shut, sending it to suspend, and open it again, lets say, 10 minutes later (which are 600 seconds), then the .wait()-timeout has already gone. I would assume, cause it's a /timeout/ that it should then fire ASAP, but it fires never. The worker process is just frozen and has to be awoken by .set()ing the Event.

I workarounded it by creating another thread, which uses time.sleep(300) instead of multiprocessing.Event.wait(300) to wait 300 seconds and some glue to put it all together.

some stats:
me at mybox:~$ python2.7
Python 2.7.1+ (default, Apr 20 2011, 22:33:39) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
me at mybox:~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux testing (wheezy)
Release:	testing
Codename:	wheezy

messages: 140165
nosy: mokrates
priority: normal
severity: normal
status: open
title: multiprocessing.Event.wait(n) doesn't time out properly
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list