Re: fixed time slices?
- From: "Arkady Frenkel" <arkadyf@xxxxxxxxxxxxxxxx>
- Date: Wed, 27 Jun 2007 09:36:29 +0300
Don't forget that schedular isn't so stupid :) and do priority boost as
defined
Arkady
"Jan Bruns" <testzugang_janbruns@xxxxxxxx> wrote in message
news:4681c909$0$20290$9b4e6d93@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
"m" <m@xxx>:
"Jan Bruns":
Shouldn't this be possible for any other event, too?[update the timer-value]
An event can only become signaled if the system sets it.
So the system would be able to directly call the scheduler,
whenever it signals an event. The scheduler would in turn
update it's timer, and decide wether to continue the thread
that raised the signalling, or to switch to a higher priority
thread that is yet runnable.
Yes the system does call the scheduler when a sync API is called but in
complex cases the scheduler cannot behave omnipotently.
It does?
Consider a relativly simple case where three threads are involved A, B, &
C
with priorities low, med, & high respectively. Threads B & C are waiting
on
a mutex and thread A running on CPU 1 signals it. The scheduler then
runs,
detects thread C as ready to run and switches CPU 1 to thread C. Even if
Why "even if"? If there's only one CPU, then it's the normal situation
that only one of the threads with highest priority can be run at a time.
there is a CPU 2 for thread B to run on, which might be executing a
thread D
with even lower priority, there is no way to execute thread B immediately
without somehow signalling CPU 2 and by the time you did that CPU 2 might
be
executing a higher priority thread than B. CPU 2 might also be
scheduling
threads and detect thread B before you could signal it or it might be
halted
waiting for work to do. There is no way to tell; and even if your could,
the information could be out of data before you could act on it.
Ok, if one CPU cannot interupt others immediately there might be special
cases where it's not possible to fully guarantee that lower priority
task don't run when higher priority threads are ready.
However, an operating system could try to minimize such situations
(specially compared to "fixed raster" scheduling).
This scheduling is further complicated by APCs (kernel & user), thread
ideal
processors, affinity masks and NUMA architectures.
I actually don't have any plans to write/sell an operating system.
The short answer is that while it may seem trivial to say that the
scheduler
should do something, the best you can do in windows is to set your thread
priorities (carefully) and assume that the scheduler will schedule your
threads some time close to when you want them to run; and you can improve
the precision of scheduler, at some performance cost, by using APIs like
TimeBeginPeriod.
From the application developer's point of view, there might be situations
where it's difficult to explain endusers why they must wait for things
to be done, when it's possible to do these things faster.
Also, no operating system is ever perfect. So there will be a continued
need to have user-mode software perform things that would really be
called a system task. "Raster-scheduling" alone significantly limits the
possibilities to do this (if you consider a siginificant overhead in
using very small rasters).
Thanks for confirming that the mmTimer API really changes the
application's "scheduling raster".
Gruss
Jan Bruns
.
- Follow-Ups:
- Re: fixed time slices?
- From: Jan Bruns
- Re: fixed time slices?
- References:
- fixed time slices?
- From: Jan Bruns
- Re: fixed time slices?
- From: Don Burn
- Re: fixed time slices?
- From: m
- Re: fixed time slices?
- From: Jan Bruns
- Re: fixed time slices?
- From: Jan Bruns
- Re: fixed time slices?
- From: m
- Re: fixed time slices?
- From: Jan Bruns
- Re: fixed time slices?
- From: m
- Re: fixed time slices?
- From: Jan Bruns
- Re: fixed time slices?
- From: m
- Re: fixed time slices?
- From: Jan Bruns
- Re: fixed time slices?
- From: m
- Re: fixed time slices?
- From: Jan Bruns
- fixed time slices?
- Prev by Date: Re: fixed time slices?
- Next by Date: Re: Get Process List from window Service
- Previous by thread: Re: fixed time slices?
- Next by thread: Re: fixed time slices?
- Index(es):
Relevant Pages
|