[ale] Scheduling questions

Bjorn Dittmer-Roche dittmeb at mail.rockefeller.edu
Mon Nov 24 22:40:36 EST 2003


Hey all,

	I have volunteered to write some stuff about acheiving low latency
on Unix (like) OSes for an audio list I'm on. It's coming along OK but
here are two issues that I'm having particular trouble with:

* Here is what I say about general purpose timesharing:

--------------------------------

Without any special attention, Unix scheduling uses a default time-sharing
scheduler that works somthing like this:  each process is given a "nice
value" and an initial priority. If a process uses lots of CPU time, it's
priority is reduced, otherwise it might be increased, but never above the
"nice value". At any given time, the Kernel selects the runnable process
with the highest priority to run. If several processes are runnable and
all have the same priority, it may split the time between them in some way
or it may just run one of them until it is no longer runnable.

--------------------------------

Of course this varies from system to system so I'm just trying to give
people an idea. Is it more or less correct?

* The other question is this: does POSIX define the relationship between
pthread scheduling and process scheduling? That is, if I have a processess
with a given priority and threads that all have their own priorities, will
each thread be scheduled by the OS or will they be "sub-scheduled" within
the process. More important than POSIX: do implementations generally agree
one way or the other? I've done some googling, but I haven't seen this
issue addressed (except for particular OSes), so maybe someone knows a
good link? My impression is that Posix specifies subscheduling but that
some implementations extend this. seem right?

thanks for any help!


	bjorn



More information about the Ale mailing list