[New-bugs-announce] [issue25084] remove semi-busy loop in py2.7 threading.Condition.wait(timeout=x)

Flavio Grossi report at bugs.python.org
Sun Sep 13 15:40:42 CEST 2015


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 <report at bugs.python.org>
<http://bugs.python.org/issue25084>
_______________________________________


More information about the New-bugs-announce mailing list