A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-November/093547.html below:

[Python-Dev] Reworking the GIL

[Python-Dev] Reworking the GIL [Python-Dev] Reworking the GILSturla Molden sturla at molden.no
Mon Nov 2 15:22:02 CET 2009
Sturla Molden skrev:
>
> I would turn on multimedia timer (it is not on by default), and 
> replace this
> call with a loop, approximately like this:
>
> for (;;) {
>   r = WaitForMultipleObjects(2, objects, TRUE, 0);
>   /* blah blah blah */     QueryPerformanceCounter(&cnt);    if (cnt > 
> timeout) break;
>   Sleep(0);
> }

And just so you don't ask: There should not just be a Sleep(0) in the 
loop, but a sleep that gets shorter and shorter until a lower threshold 
is reached, where it skips to Sleep(0). That way we avoid hammering om 
WaitForMultipleObjects and QueryPerformanceCounter more than we need. 
And for all that to work better than just giving a timeout to 
WaitForMultipleObjects, we need the multimedia timer turned on.

Sturla



More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4