Re: [Development] Windows Timer Resolution: The Great Rule Change

2020-10-08 Thread Thiago Macieira
On Thursday, 8 October 2020 14:33:59 PDT Philippe wrote: > > > Thiago Macieira wrote: > > If nothing is signaled, why are they waking up at all? > > Let me rephrase otherwise: > if one calls WaitForSingleObject or WaitForMultipleObjects > with a timeout of 1 millisecond, then these functions > wo

Re: [Development] Windows Timer Resolution: The Great Rule Change

2020-10-08 Thread Giuseppe D'Angelo via Development
Il 08/10/20 23:33, Philippe ha scritto: Let me rephrase otherwise: if one calls WaitForSingleObject or WaitForMultipleObjects with a timeout of 1 millisecond, then these functions won't return before 15 milliseconds (provided the events don't get signaled during that period). But what would the

Re: [Development] Windows Timer Resolution: The Great Rule Change

2020-10-08 Thread Philippe
> > Thiago Macieira wrote: > If nothing is signaled, why are they waking up at all? Let me rephrase otherwise: if one calls WaitForSingleObject or WaitForMultipleObjects with a timeout of 1 millisecond, then these functions won't return before 15 milliseconds (provided the events don't get signal

Re: [Development] Windows Timer Resolution: The Great Rule Change

2020-10-08 Thread Thiago Macieira
On Thursday, 8 October 2020 02:00:13 PDT Konstantin Tokarev wrote: > Is resolution of QElapsedTimer limited to 15 ms as well? If it's more find > grained you can try busy-waiting until required time elapses. Any such submission to Qt will get an immediate -2 from me. If you really need it, you ca

Re: [Development] Windows Timer Resolution: The Great Rule Change

2020-10-08 Thread Thiago Macieira
On Thursday, 8 October 2020 01:43:38 PDT Philippe wrote: > On Wed, 7 Oct 2020 17:34:43 -0700 > > Thiago Macieira wrote: > > Now, the question is how WaitFor{SingleObject,MultipleObjects} are > > affected. Does this mean that asking for a timeout of 2 milliseconds > > could result in being 13 seco

Re: [Development] Windows Timer Resolution: The Great Rule Change

2020-10-08 Thread Konstantin Tokarev
08.10.2020, 11:46, "Philippe" : > On Wed, 7 Oct 2020 17:34:43 -0700 > Thiago Macieira wrote: > >>  Now, the question is how WaitFor{SingleObject,MultipleObjects} are affected. >>  Does this mean that asking for a timeout of 2 milliseconds could result in >>  being 13 seconds too late? > > I just

Re: [Development] Windows Timer Resolution: The Great Rule Change

2020-10-08 Thread Philippe
On Wed, 7 Oct 2020 17:34:43 -0700 Thiago Macieira wrote: > Now, the question is how WaitFor{SingleObject,MultipleObjects} are affected. > Does this mean that asking for a timeout of 2 milliseconds could result in > being 13 seconds too late? I just did a test, and yes, both WaitForSingleObject

Re: [Development] Windows Timer Resolution: The Great Rule Change

2020-10-08 Thread Giuseppe D'Angelo via Development
Il 08/10/20 02:34, Thiago Macieira ha scritto: Now, the question is how WaitFor{SingleObject,MultipleObjects} are affected. Does this mean that asking for a timeout of 2 milliseconds could result in being 13 seconds too late? I hope you meant *milli*seconds... But anyhow, WaitForX allow for _e

Re: [Development] Windows Timer Resolution: The Great Rule Change

2020-10-07 Thread Thiago Macieira
On Wednesday, 7 October 2020 06:47:27 PDT Philippe wrote: > Obviously, QThread::msleep is affected, but probably other APIs with a > timeout (?) > > https://randomascii.wordpress.com/2020/10/04/windows-timer-resolution-the-gr > eat-rule-change/ Any and all uses of "sleep" are wrong. Given that th

[Development] Windows Timer Resolution: The Great Rule Change

2020-10-07 Thread Philippe
To whoever is concerned... In short: "The behavior of the Windows scheduler changed significantly in Windows 10 2004" Especially, the "common" thread sleep function with 1 as argument "Sleep(1)", that did cause the thread to sleep about 1 or 2 milliseconds, is now halting for 15 milliseconds.