[comp.os.xinu] Process quantum

guitin@imag.imag.fr (Guilbot-martin) (06/12/89)

Round-robin among processes with equal priority and that are eligible for CPU
service can only occurs when the quantum time is passing away. The round-robin
actually occurs on rsched calls. Thus, the procedure ready must refuse context
switching for processes with equal priority and that are eligible for CPU 
service. Otherwise, system calls like resume, signal, and that use ready can
give a context switching. For example, a process that signals an other one 
with the same priority will lost the CPU for a while.
-- 
guitin@imag.imag.fr      guitin@imag.UUCP      uunet.uu.net!imag!guitin
Guilbot-Martin,ENSIMAG, BP 53X , 38041 Grenoble, France

serge@imag.imag.fr (Serge Rouveyrol) (06/12/89)

In article <5123@imag.imag.fr> guitin@imag.imag.fr (Guilbot-martin) writes:
>give a context switching. For example, a process that signals an other one 
>with the same priority will lost the CPU for a while.

An other problem is that the quantum is real and not virtual.
If a process  is in a waiting state (after an I/O for example),
when this process will be awake, it will not found the rest of its quantum.
The variable preempt must be save in the context of the process when
the process is not active and restore when the process is active .

ps) Mes excuses pour ce dialecte qui se veut etre de l'anglais.

-- 
"Les jours de pluie ...  etc ... "
serge@imag.imag.fr      serge@imag.UUCP      uunet.uu.net!imag!serge
Rouveyrol Serge,Laboratoire L.G.I,BP 53,38041 Grenoble , CEDEX , FRANCE

comer@CS.PURDUE.EDU (Douglas Comer) (06/13/89)

Guilbot-Martin,

   If I understand your letter, it basically raises the question of why
system calls other than time-slicing can cause context switching.  The
answer is that the Xinu priority scheme allows any process that becomes
ready to gain the CPU provided that no higher priority process is executing.
This makes sense in most applications and is *necessary* in a real-time
environment.  One possible modification is to keep with each process a
value that represents "remaining time in timeslice".  The value would be
saved when the process loses control of the CPU and restored when the
process regains control.  In considering this alternative, I decided
that the slight improvement in precision did not justify the accompanying
increase in overhead.

Doug