Under multi-tasking environment, concurrent accesses to a global resource (i.e. a global variable, hardware) from multiple tasks is a critical issue. nxtOSEK provides OSEK Resource feature to keep data integrity between multiple tasks. resourcetest example under samples\resourcetest directory describes an usage of OSEK GetResource and ReleaseResource API. In resourcetest example, there are two tasks and each of those accesses a global resource (LCD display). Each Task displays numerical value in the LCD display (values with green background color in the below figure) and GetResource API which is invoked in LowTask makes HighTask being blocked at the invocation of GetResource API in the HighTask. OSEK Resource API dynamically change the priority of the Task to protect the shared global resources. This technology is called the OSEK Priority Ceiling Protocol.
Back to Samples