Re: wait for process terminate

From: Rob Kennedy (me3_at_privacy.net)
Date: 10/11/04


Date: Mon, 11 Oct 2004 15:49:07 -0500

Maarten Wiltink wrote:
> "David Reeve" <dree4456@big-pond.net.au> wrote in message
> news:fTwad.22406$5O5.10922@news-server.bigpond.net.au...
>> Either way, the time slice should be yielded.
>
> Yes, but not at once. Only at the end of its nap. In fact, I'm not sure
> if Sleep() does or should in fact release the timeslice for delays
> other than zero.

The only time Sleep does not release its timeslice is when its argument
is 0 and there are no other qualifying threads waiting to be scheduled.
With a non-zero timeout, Sleep will release its timeslice, and it will
not be awarded another timeslice until at least that many milliseconds
have elapsed. If there are no other qualifying threads in the meantime,
then I don't know what happens, but that's for the OS to determine.

-- 
Rob


Relevant Pages

  • Re: wait for process terminate
    ... >is 0 and there are no other qualifying threads waiting to be scheduled. ... >With a non-zero timeout, Sleep will release its timeslice, and it will ... scheduler allocating fixed timeslices - I suspect that the sceduler ...
    (comp.lang.pascal.delphi.misc)
  • Re: using select as a sleep call
    ... I can not sleep for 1 millisecond only. ... if i set the sleep to longer than 4 milliseconds the elapsed time ... a the duration of a timeslice, ... Switching between processes takes time. ...
    (comp.unix.programmer)
  • Re: Hierarhical locking
    ... the dispatcher will extend the time slice a little bit ... IBM's patenting the automatic abort on timeslice end. ...
    (comp.programming.threads)
  • Sleep(DWORD) returns in _less_ time than specified
    ... Win32 Sleep is documented to return in no less than the time specified. ... bug in either the implementation or documentation. ... (sleepTime / TIMESLICE) ...
    (microsoft.public.win32.programmer.kernel)
  • Re: How do I Sleep for a specified amount of time and relinquish c
    ... would in fact do a spin wait until the timeslice is up. ... Sleep() (.NET or Windows API) with a non-zero value, ... time believing you've seen any official documentation that says otherwise. ...
    (microsoft.public.dotnet.framework)