Author: Dr Kaarthick Balakrishnan
In Non preemptive tasks ; runnables are mapped to OS tasks. Both the high and low priority tasks will need the same semaphore to execute the task. The OS task holds the semaphore while execution and when higher priority tasks are triggered by the RTE the higher priority tasks cannot be executed as the lower priority task holds the semaphore. After the execution of the lower priority task the semaphore will be released and then the higher priority task shall be executed.
In AUTOSAR OS, the runnables are mapped only to a single task but they can be triggered by different RTE Events. When runnables are mapped to Mutually exclusive areas , the runnables once called by an RTE event cannot be triggered during execution by another RTE event as the runnable will release the semaphore only after the runnable is executed. This way the runnables can be prevented from preemption during their execution.
In Mutually exclusive areas, the same runnables can be triggered by different OS tasks. When runnables are mapped to mutually exclusive areas; runnables are assigned a semaphore . The runnables shall be mapped to different OS tasks – (OSEK OS). For instance if a lower priority task is executing the runnable. A higher priority Task may preempt the lower priority task but the task cannot trigger the runnable as the runnable is holding the semaphore. Only after executing the runnable that is called by the lower priority task the higher priority task can execute the runnable.