C/Visual C - FUNCION sched()...explicacion

 
Vista:
sin imagen de perfil

FUNCION sched()...explicacion

Publicado por ceokin (1 intervención) el 11/05/2011 02:50:39
Hola a todos,estoy haciendo una práctica de MINIX sobre planificacion de procesos, lo que quiero hacer es pasar de ROUND-ROBIN a uno con prioridad no apropiativo, me gustaria saber que hace esta funcion ,.¿alguien me lo puede explicar?MUCHAS GRACIAS.


/*================================================= ======
* sched *
*================================================= ==*/
PRIVATE void sched()
{int n;
/* The current process has run too long. If another low priority (user)
* process is runnable, put the current process on the end of the user queue,
* possibly promoting another user to head of the queue.
*/

if (rdy_head[USER_Q] == NIL_PROC) return;
n = proc_number(rdy_head[USER_Q]);
if(count[n]==0) {
/* One or more user processes queued. */
rdy_tail[USER_Q]->p_nextready = rdy_head[USER_Q];
rdy_tail[USER_Q] = rdy_head[USER_Q];
rdy_head[USER_Q] = rdy_head[USER_Q]->p_nextready;
rdy_tail[USER_Q]->p_nextready = NIL_PROC;
count[n] = priority[n];
} else count[n]--;
pick_proc();
}
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder