-
Notifications
You must be signed in to change notification settings - Fork 3
English manual
Shuta Kimura edited this page Aug 20, 2019
·
6 revisions
'TinyThreads' is a library which provides multi-threading environment with POSIX thread (pthread) compatible APIs for embedded boards with 32-bit microcontrollers. You can easily build a multi-threaded environment under limited ROM/RAM sizes.
- Pros
- Because it conforms to POSIX thread API, you don't need to learn new API.
- Because it is designed to be integrated with IDE of each CPU, you can easily apply to your projects.
- Cons
- The kinds and functions of synchronization object is less than other RTOSs. (It is a constraint to making API to be POSIX compliant)
- For example, there is no equivalent to event flags which can be handled in interrupt handlers.
- The kinds and functions of synchronization object is less than other RTOSs. (It is a constraint to making API to be POSIX compliant)
TinyThreads is distributed under the MIT License.
Currently, following processors are supported.
- Intel(Altera) Nios II
- Xilinx Zynq-7000 (Cortex-A9)
-
Microchip PIC32 series (PIC32MX, PIC32MZ)(discontinued)
- Multi-thread control by time-slicing on single core processor.
- Scheduling based on priority and policy (Round-robin or FIFO) of each thread.
- Force thread switching by preemption.
- Dynamic thread creation and termination (
pthread_create
/pthread_exit
) - Waiting for threads' temination (
pthread_join
) - Mutex (
pthread_mutex_*
) - Conditional variables (
pthread_cond_*
) - Once control (
pthread_once_*
) - Semaphore (
sem_*
)-
sem_post
is a only function which can be used safely in interrupt handlers.
-
- Sleep functions (
sleep
,usleep
)- Not Pthreads API, but TinyThreads scheduler can provide efficient sleep functionality.
- Thread name (
pthread_getname_np
/pthread_setname_np
)- Not POSIX standards, but these functions may help you in debugging.
See API List for details.
- Barrier (
pthread_barrier_*
) - Spin lock (
pthread_spin_*
) - Reader-writer lock (
pthread_rwlock_*
) - TLS (Thread Local Storage) (
pthread_key_*
etc.)
The following functions are not supported. They are judged unnecessary under the embedded environment, and there is no plan to support in the feature.
- Canceling (
pthread_cancel
etc.) - Signal functions (
pthread_sig*
)