Inter-Process communication

Semaphores

POSIX REALTIME semaphores are fully implemented: sem_init(), sem_destroy(), sem_getvalue(), sem_post(), sem_trywait() and sem_wait(). These are counting semaphores.

Mutex

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:

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.

Priority inversion control

Mutex provide immediate priority inheritance.

Messages queues

There is no message queues available.

Mailboxes

There is no mailboxes.

Shared memory

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.

FIFOs

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.