|WP1 - RTOS State of the Art Analysis: Deliverable D1.1 - RTOS Analysis|
|Prev||Chapter 8. RTLinux/GPL||Next|
POSIX REALTIME semaphores are fully implemented: sem_init(), sem_destroy(), sem_getvalue(), sem_post(), sem_trywait() and sem_wait(). These are counting semaphores.
RTLinux supports the POSIX pthread_mutex_ family of functions: pthread_mutex_init(), pthread_mutex_destroy(), pthread_mutex_lock(), pthread_mutex_trylock() and pthread_mutex_unlock(). As well as all the supporting, pthread_mutexattr_... like, functions to handle mutex creation attributes.
The supported mutex types are:
PTHREAD_MUTEX_NORMAL: The default POSIX mutex.
PTHREAD_MUTEX_SPINLOCK_NP: Provides a interface to spin-locks used to synchronize the execution in multiprocessor systems.
The supported mutex protocols are:
PTHREAD_PRIO_NONE:No priority control is performed on locking and unlocking.
PTHREAD_PRIO_PROTECT: Immediate priority inheritance. The thread that locks the mutex inherits the priority ceiling of the semaphore, and returns to the original priority when the unlocks the mutex.
Mutex provide immediate priority inheritance.
There is no message queues available.
There is no mailboxes.
shared memory is provided with a non-POSIX interface called mbuff. Since all threads are executed in the kernel address space (rtlinux threads share by default all the memory), this sharing memory mechanism is used to communicate rtlinux threads and normal linux processes.
Both execution environments, RTLinux and Linux, have the same mbuff API.
Following the idea that not dynamic memory allocation can be requested during normal system execution, allocation and releasing functions can not be used from RTLinux threads, only at module loading or by linux processes.
RTLinux provide a single IPC called FIFO. It is First-In-First-Out queues that can be read from and written to by Linux processes and RTLinux threads. FIFOs are uni-directional - you can use a pair of FIFOs for bi-directional data exchange.