This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Radosław.Szkodziński
Recipients Radosław.Szkodziński, steve.dower, tim.golden, zach.ware
Date 2014-12-02.10:09:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1417514973.26.0.394264585481.issue22976@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2014-12-02 10:09:33Radosław.Szkodzińskisetrecipients: + Radosław.Szkodziński, tim.golden, zach.ware, steve.dower
2014-12-02 10:09:33Radosław.Szkodzińskisetmessageid: <1417514973.26.0.394264585481.issue22976@psf.upfronthosting.co.za>
2014-12-02 10:09:33Radosław.Szkodzińskilinkissue22976 messages
2014-12-02 10:09:32Radosław.Szkodzińskicreate