[issue22976] multiprocessing Queue empty() is broken on Windows

2021-02-23 Thread Eryk Sun


Change by Eryk Sun :


--
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22976] multiprocessing Queue empty() is broken on Windows

2014-12-02 Thread Radosław Szkodziński

New submission from Radosław Szkodziński:

multiprocessing.Queue.empty() uses pipe polling on Windows. Unfortunately, pipe 
semantics on windows are different from POSIX.

The result is either:
- Hang when one process tries to get() and another checks for empty()
- Falsely returning empty() == False despite nothing being possible to get - 
because the other process is actually trying to read from the queue.

The attached testcase demonstrates the first case, with main process hard 
hanging on my Python 2.7.8 (anaconda), 32-bit on Windows 7 64-bit. Whether 1 or 
2 happens depends on specific program flow.
Both can cause deadlocks in code that should be valid.

Note that get(block=False) actually works correctly.

It is possible that the problem is also present in Python 3.

--
components: Library (Lib), Windows
files: testmp.py
messages: 231984
nosy: Radosław.Szkodziński, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: multiprocessing Queue empty() is broken on Windows
versions: Python 2.7
Added file: http://bugs.python.org/file37342/testmp.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22976
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22976] multiprocessing Queue empty() is broken on Windows

2014-12-02 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +sbt

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22976
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22976] multiprocessing Queue empty() is broken on Windows

2014-12-02 Thread eryksun

eryksun added the comment:

This also hangs for me in 2.7.8 64-bit, Windows 7. To poll the pipe, the parent 
process calls PeekNamedPipe, which blocks because the child has already called 
ReadFile.

 It is possible that the problem is also present in Python 3.

multiprocessing switched to overlapped I/O in 3.3, which avoids this problem.

--
nosy: +eryksun

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22976
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com