Hardware Reference
In-Depth Information
/*-----------------------------------------------------------*/
/* guarantee -- guarantees the feasibility of a hard task */
/*-----------------------------------------------------------*/
int
guarantee (proc p)
{
util fact = util fact + vdes[p].util;
if (util fact > 1.0)
{
util fact = util fact - vdes[p].util;
return(FALSE);
else return(TRUE);
}
The system call activate inserts a task in the ready queue, performing the transition
SLEEP-READY. If the task is HARD, its absolute deadline is set equal to the current
time plus its period. Then the scheduler is invoked to select the task with the earliest
deadline.
/*-----------------------------------------------------------*/
/* activate -- inserts a task in the ready queue */
/*-----------------------------------------------------------*/
int activate (proc p)
{ save context();
if (vdes[p].type == HARD)
vdes[p].dline = sys clock + (long)vdes[p].period;
vdes[p].state = READY;
insert(p, &ready);
schedule();
load context();
}
Search WWH ::




Custom Search