Multithread

A collection of modules for programming in multithreaded environments (obviously all thread safe).

Note

Provides some wrappers around POSIX multithread primitives (e.g., sem_t) which may seem unnecessary, BUT provides a small Platform Abstraction Layer (PAL) so that applications can use the same API on Linux, RTEMS, etc.

The multithread library is comprised of the following modules:

Module

Notes

Link

Memory pool

Used by threads to request/release memory chunks of a specified size. Useful in publisher-subscriber settings (e.g., swbus).

mpool

Binary semaphore

On linux: built out of a mutex and condv.

bsem

Condition variable

On linux: Wrapper around POSIX condition variables.

condv

Counting semaphore

On linux: wrapper around POSIX semaphores.

csem

Mutex

On linux: wrapper around POSIX mutexes.

mutex

Condition variable/mutex pair (cvm)

A single interface for using both, as they are frequently used together.

cvm

Producer-consumer queue

Can handle multiple producers and consumers

pcqueue

Fair reader/writer lock

A completely fair lock that guarantees that neither readers nor writers will starve.

rdwrlock

OpenMP modules

Implementations of 2D kernel convolution, radix sort

omp_kernel2d_convolve1(), omp_radix_sorter

Thread management tools

E.g., locking threads to a particular core.

N/A