Nanokernel mutex services.
[Xenomai scheduler.]


Detailed Description

Nanokernel mutex services.

[WARNING] Mutex services are deprecated in newer versions of the Xenomai nucleus, basically due to design and performance issues. Do not use this facility if you plan to port to RTAI/fusion.

Mutexes are internal synchronization objects that do NOT rely on the standard nanokernel scheduling routines to operate. However, they share the same protocol inheritance scheme with the regular xnsynch objects for the sake of clarity and efficiency. In other words, code in mutex.c and synch.c cooperate on the same logic and data structures for handling PIP both for kernel mutexes and regular resources.

One should keep in mind that a thread claiming a mutex is NOT actually suspended, but the current mutex owner is simply rescheduled before the "sleeper" instead. Priority inheritance allows to boost the current mutex owner so that it can release the lock as soon as possible.

Consequently, blocking or suspending a thread that holds a mutex is a BUG! However, the nanokernel provides for a special mechanism that releases a given interface mutex atomically when xnpod_suspend_thread() is called for the current thread, reacquiring it on return of this routine. This mechanism should be understood as a lock-breaking preemption point atomically performed just before the current thread is switched out.

See also:
xnpod_schedule() for more on this.


Files

file  mutex.c
 Nanokernel mutex services.


Generated on Sat Jul 24 19:36:22 2004 for RTAI API by doxygen 1.3.4