The Microkernel

Top  Previous  Next

The configurer automatically places an appropriate microkernel on every CPU. Among the jobs the kernel performs are the following:


scheduling all the threads running on the processor;

managing the interprocessor links and channels;

controlling the timer;

providing the primitives for implementing semaphores and events;

handling interrupts.

The kernel is a passive part of the system; it consumes processor cycles only when asked to do something, either as the result of an interrupt or an explicit program request (for example, a link or semaphore operation).

 

C6000 TIMER0 interrupts are used by the kernel to manage its internal clock (timer_now, timer_delay, and timer_wait), and for timeslicing (if you have just a single thread on a processor, there is no timeslicing). Timer management takes approximately 30 CPU cycles every millisecond. By setting CLOCK=0 for the processor, kernel clock interrupts and timeslicing are stopped; all processor cycles are available to your code, although this extreme step is rarely beneficial.

 

The kernel is very efficient; its performance does not depend on the number of threads in the system.

 

 

Every task is passed a handle to the kernel, visible as the variable _kernel. Usually you do not need to be aware of this, but certain functions require it as a parameter (the external interrupt handling functions, for example).