C++/VB - Variance Of "Error" In Delay For Wait Functions.

Asked By Le Chaud Lapin
05-Jan-10 12:34 AM
Hi All,

First, I realize that Windows is not an RTOS. :)

I would like to know the mean and variance, probabilistically-
speaking, of the "error" from the specified delay in
WaitForSingleObject, WaitForMultipleObject, WaitableTimers, etc.

For example, if I specify 600 seconds, there is a pretty good chance
that the break will occur right around 600 seconds. If it occurs at
599 seconds, 987 milliseconds, the error would be 13 milliseconds.

For 600 seconds, it will likely not occur after 5 seconds, nor after
17 hours, as the error would be 595 seconds, and 16 hours, 55 minutes;
respectively, to use two extreme examples.

What is the mean error under "typical" circumstances.  What is
variance of this error?

Also, does Windows still use ing the 18.2-millisecond quantum from the
wee-old days of original IBM PC?

-Le Chaud Lapin-
WaitForMultipleObject
(1)
WaitableTimers
(1)
Variance
(1)
Windows
(1)
Lapin
(1)
Latency
(1)
Kernels
(1)
Timer
(1)
  Alexander Grigoriev replied to Le Chaud Lapin
04-Jan-10 09:53 PM
The quantum was not 18.2 ms. it was 1/18.2s ~ 55ms.

In modern Windows kernels the time slice (and timer tick) is usually
10-15ms.
  m replied to Le Chaud Lapin
08-Jan-10 09:13 PM
From a probabilistic point of view, the first thing to realize is that the
error is all positive skew up to thread quantum + timer interrupt latency +
chi;  where chi is the hard part - the time required by higher priority
tasks discounted by the Windows scheduler guaranteed that it is fair to all
threads.  Usually this value is negligible.
Create New Account
help
the system from the S5 (soft off) state. Also, I have determined that the Win32 WaitableTimers can wake the system from the S4 (hibernate) state which is nearly identical to S5. So, I am assuming the WaitableTimers API has the ability to set the system's auto-on timers. Perhaps when Windows Thanks in advance for any help you can provide. -Brett Win32 Kernel Discussions SetWaitableTimer (1) WaitableTimers (1) Windows (1) Providedby (1) Wakeable (1) Timer (1) BIOS (1) ACPI (1) Windows sets
to wait for my events and all seems to be ok. I use the function WaitForMultipleObject to wait for my events. The problem is that when the function WaitForMultipleObjects returns with in this error. . . so thank you for your help! Win32 DirectX Audio Discussions WiatForMultipleObjects (1) WaitForMultipleObject (1) CaptureBuffer (1) CreateEvent (1) DirectShow (1) ResetEvent (1) Microphone (1) Audio (1) Make sure
hadlerEventYouHaveANewJob ) / / signal event in the posted Thread } 3. and in thread ThreadProc I do: { case WaitForMultipleObject( hadlerEventYouHaveANewJob, hadlerEventStopThread, . . . . . . ) WAIT_OBJECT_0 : RunProcedureYouHaveNewJob WAIT_OBJECT_1 : RunExitThreadProc } so, I see my idea is quite long and I need to get a handler (event or sth) which I can put to the WaitForMultipleObject function (or similar I haven't known). Best Regards Tomasz Rutkowski Win32 Kernel Discussions HadlerEventYouHaveANewJob (1) RunProcedureYouHaveNewJob (1) WaitForMultipleObject (1) MyPostThreadMessage (1) RunExitThreadProc (1) HadlerEventStopThread (1) PostThreadMessage (1) ServiceThread (1) I am not sure