New submission from Flavio Grossi: threading.Condition.wait(timeout=x) is implemented in python 2 as a semi-busy loop which causes cpu wakeups and unexpected cpu use.
I think this is somewhat problematic since it causes problems in all modules which use that method, such as Queue.get() when used with a timeout. This issue has been reported and "fixed" in red hat based distributions in a way which i find problematic, as detailed here: https://bugzilla.redhat.com/show_bug.cgi?id=1230802 The attached patch backports the following change from py3 to fix the problem: https://hg.python.org/cpython/rev/01d1fd775d16/ ---------- components: Library (Lib) files: timedlock.patch keywords: patch messages: 250562 nosy: flavio, pitrou priority: normal severity: normal status: open title: remove semi-busy loop in py2.7 threading.Condition.wait(timeout=x) type: enhancement versions: Python 2.7 Added file: http://bugs.python.org/file40450/timedlock.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25084> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com