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 xdegaye
Recipients Alex.Willmer, ncoghlan, neologix, pitrou, rhettinger, vstinner, xdegaye, yan12125
Date 2016-05-16.16:09:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463414961.92.0.145191883603.issue26939@psf.upfronthosting.co.za>
In-reply-to
Content
On a heavily loaded system, there is no guarantee that the date obtained from a call to gettimeofday() in PyCOND_TIMEDWAIT(), is not in the past when pthread_cond_timedwait() is called, as there may be a context switch in between. When this happens, a Python thread cannot take the gil even if it is available.

This tentative patch monitors the load of the system and dynamically increases the value used for the switch interval when needed. With this patch on the android-21-armv7 emulator:

python -m test -m test_lru_cache_threaded -v test_functools
Ok
python -m test -m test_deadlock -v test_importlib
Ok
python -m test -m test_is_alive_after_fork -v test_threading
Ok

The measured elapsed time is not correct in this patch when it is above 1 second.
History
Date User Action Args
2016-05-16 16:09:21xdegayesetrecipients: + xdegaye, rhettinger, ncoghlan, pitrou, vstinner, neologix, Alex.Willmer, yan12125
2016-05-16 16:09:21xdegayesetmessageid: <1463414961.92.0.145191883603.issue26939@psf.upfronthosting.co.za>
2016-05-16 16:09:21xdegayelinkissue26939 messages
2016-05-16 16:09:21xdegayecreate