New submission from ProgVal:

In Python 3.3, multiprocessing.Process.join() is not blocking with floats lower 
than 1.0 (not included). It works as expected (ie. blocking for the specified 
timeout) in Python 2.6->3.2

As you can see in this example, calling join() with 0.99 returns immediately.

$ python3.3
Python 3.3.1 (default, Apr  6 2013, 13:58:40) 
[GCC 4.7.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import time
>>> import multiprocessing
>>> def foo():
...  time.sleep(1000)
... 
>>> p = multiprocessing.Process(target=foo)
>>> p.start()
>>> bar = time.time(); p.join(0.99); print(time.time()-bar)
0.015963315963745117
>>> p.is_alive()
True
>>> bar = time.time(); p.join(1.0); print(time.time()-bar)
1.0011239051818848
>>> p.is_alive()
True

----------
components: Library (Lib)
messages: 187916
nosy: Valentin.Lorentz
priority: normal
severity: normal
status: open
title: multiprocessing.Process.join does not block if timeout is lower than 1
type: behavior
versions: Python 3.3

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17856>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to