Process management

LynxOS® is a hard-real-Time OS, it is fully preemptible and reentrant. It uses a RT Global Scheduler and implements priority inheritance and priority tracking so that the highest priority thread runs regardless of which process it is in or if it's a kernel thread. Moreover, it provides deterministic response-time for tasks even in the presence of multiple interrupts, the highest priority task will only be interrupted once for each device thanks to the priority tracking policy.

LynxOS® applies a uniform global priorities management:

Kernel threads may utilize 1/2 priority steps and priority tracking so they run before the user task they serve, but after higher priority user tasks

Scheduling policy:

Three scheduling policies are available :

SCHED_FIFO (first-in,first-out)

Standard POSIX FIFO policy. A preemptable fixed priority scheduler.

SCHED_RR (round robin)

SCHED_OTHER (Proprietary Lynx scheduling policy named "Priority based quantum")

This is similar to round robin policy, excepted the fact that a configurable time quantum is defined for each level of priority. This time quantum can be set using the setquantum() call.

The default value for the time quantum is 640ms. It can be modified, it is the system constant named QUANTUM defined in the configuration file /usr/include/param.h

The scheduling policy is modifiable

3 functions rinsert(),redesert(),rsched() are used to manipul ate the different scheduler queues (Ready-Queue,Fast-Ready-Queue,...) and the function newcontext() achieves context switching between processes

Periodic threads:

Barriers as defined in POSIX1.d can be used to implement periodic threads

Range of priorities and maximum number of threads:

There is up to 256 levels of priority for the application (user level) and 256 for the kernel. Moreover, half priorities are used for the priority tracking mechanism specific to LynxOS® (see below).

Thread creation and deletion:

Every thread has its own stack, register set, priority, and scheduling algorithm.

The priority is inherited from the caller of pthread_create().The schedpolicy attibute is SCHED_FIFO.

Supports thread control and cancellation model as defined by POSIX 1003.1c threads.