Skip to content

POSIX-compatible tiny multi-threading library for Intel Nios II / Xilinx Zynq-7000

License

Notifications You must be signed in to change notification settings

kimushu/tinythreads

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TinyThreads

TinyThreads is POSIX threads (pthreads) compatible tiny multi-threading library for 32-bit microcontrollers.

Currently, following processors are supported:

  • Intel(Altera) Nios II
  • Xilinx Zynq-7000 (Cortex-A9)
  • Microchip PIC32 (MIPS32 Architecture)

マニュアル / Manuals

See TinyThreads wiki.

ライセンス / License

The MIT License

対応している機能 / Supported features

ほとんどの機能は <pthread.h> ヘッダファイルで提供されます。
Most features are provided in <pthread.h> header file.

スレッド操作とスケジューリング / Thread operation and scheduling

Interface Name Conforming to Remarks
Type pthread_t POSIX.1-2001
Function pthread_create() POSIX.1-2001
Function pthread_exit() POSIX.1-2001
Function pthread_join() POSIX.1-2001
Function pthread_detach() POSIX.1-2001
Function pthread_self() POSIX.1-2001
Function pthread_equal() POSIX.1-2001
Type pthread_attr_t POSIX.1-2001
Function pthread_attr_init() POSIX.1-2001
Function pthread_attr_destroy() POSIX.1-2001
Function pthread_attr_setdetachstate() POSIX.1-2001
Function pthread_attr_getdetachstate() POSIX.1-2001
Function pthread_attr_setschedparam() POSIX.1-2001
Function pthread_attr_getschedparam() POSIX.1-2001
Function pthread_attr_setschedpolicy() POSIX.1-2001
Function pthread_attr_getschedpolicy() POSIX.1-2001
Function pthread_attr_setstack() POSIX.1-2001
Function pthread_attr_getstack() POSIX.1-2001
Function pthread_attr_setstacksize() POSIX.1-2001
Function pthread_attr_getstacksize() POSIX.1-2001
Function sched_get_priority_max() POSIX.1-2001 <sched.h>
Function sched_get_priority_min() POSIX.1-2001 <sched.h>
Function shced_yield() POSIX.1-2001 <sched.h>

ミューテックス / Mutex

Interface Name Conforming to Remarks
Type pthread_mutex_t POSIX.1-2001
Macro PTHREAD_MUTEX_INITIALIZER POSIX.1-2001
Function pthread_mutex_destroy() POSIX.1-2001
Function pthread_mutex_init() POSIX.1-2001
Function pthread_mutex_lock() POSIX.1-2001
Function pthread_mutex_trylock() POSIX.1-2001
Function pthread_mutex_unlock() POSIX.1-2001

セマフォ / Semaphore

Interface Name Conforming to Remarks
Type sem_t POSIX.1-2001 <semaphore.h>
Function sem_destroy() POSIX.1-2001 <semaphore.h>
Function sem_init() POSIX.1-2001 <semaphore.h>
Function sem_post() POSIX.1-2001 <semaphore.h> Can be used in ISR
Function sem_wait() POSIX.1-2001 <semaphore.h>
Function sem_trywait() POSIX.1-2001 <semaphore.h>

条件付き変数 / Conditional variables

Interface Name Conforming to Remarks
Type pthread_cond_t POSIX.1-2001
Macro PTHREAD_COND_INITIALIZER POSIX.1-2001
Function pthread_cond_destroy() POSIX.1-2001
Function pthread_cond_init() POSIX.1-2001
Function pthread_cond_broadcast() POSIX.1-2001
Function pthread_cond_signal() POSIX.1-2001
Function pthread_cond_wait() POSIX.1-2001

1回きりの初期化 / Once control

Interface Name Conforming to Remarks
Type pthread_once_t POSIX.1-2001
Macro PTHREAD_ONCE_INIT POSIX.1-2001
Function pthread_once() POSIX.1-2001

pthreads以外の機能 / Features outside of pthreads

以下のAPIは、本来pthreadsのカバーする範囲ではありませんが、マルチスレッド環境に対して効率的な実装をTinyThreadsが提供できるものです。 The following APIs are outside of pthreads but TinyThreads can provide a more effective implementation for multi-threading environment.

Interface Name Conforming to Remarks
Function sleep() POSIX.1-2001 <unistd.h>
Function usleep() POSIX.1-2001 <unistd.h>

削除されている機能 / Dropped features

以下に挙げる機能はTinyThreadsが目指す「小さなマルチスレッド環境」に不要と判断され、 削除された機能です。原則として、将来も対応する予定はありません。
The features below are dropped because they are not useful in "tiny" multi-threading environment. As a general rule, they have never been supported in the future.

  • pthread_atfork()
  • pthread_cancel()
  • pthread_key*()
  • pthread_getspecific()
  • pthread_setspecific()
  • sem_open()
  • sem_unlink()