Supplementing Generated C : Scheduler Package : Special Services

Special Services

The following routine causes the calling task to be delayed for the specified number of seconds. It also causes rescheduling so that other tasks may advance while this task is delayed.

sched_delay(time_amount)
double time_amount ;
 

Each task can request a time slice which is the maximal time period for which the task may hold the CPU without rescheduling another task. The request is made by calling the following routine:

sched_slice(time_slice)
double time_slice ;
 

To disable the time-slicing for some task, it should call this routine with a time slice of 0.0. This is also the default with which each task is initialized.

To disable and enable the time slicing mechanism for all the tasks, the following routines may be called:

sched_enable()
sched_disable()
 

Note that when time slicing is disabled, delays, timeouts and scheduled actions initialized by the scheduler (either before or after sched_disable has been called) cannot end until sched_enable is called. We recommend disabling the time slicing when performing print statements. Unexpected results may occur.