1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
|
- This version provides a subset of POSIX interface. Several example
programs demonstrate the new interface. Old programs will still run,
however you are encouraged to migrate your programs to POSIX.
POSIX interface functions available in this release:
clock_gettime
clock_settime
clock_getres
time
usleep
nanosleep
sched_get_priority_max
sched_get_priority_min
pthread_self
pthread_attr_init
pthread_attr_getstacksize
pthread_attr_setstacksize
pthread_attr_setschedparam
pthread_attr_getschedparam
pthread_attr_setdetachstate
pthread_attr_getdetachstate
pthread_yield
pthread_setschedparam
pthread_getschedparam
pthread_attr_setschedparam
pthread_attr_getschedparam
pthread_create
pthread_exit
pthread_cancel
pthread_setcanceltype
pthread_setcancelstate
pthread_join
pthread_kill (signals supported: 0, RTL_SIGNAL_SUSPEND, RTL_SIGNAL_WAKEUP,
RTL_SIGNAL_CANCEL)
pthread_mutexattr_getpshared(3),
pthread_mutexattr_setpshared(3),
pthread_mutexattr_init(3),
pthread_mutexattr_destroy(3),
pthread_mutexattr_settype(3),
pthread_mutexattr_gettype(3),
pthread_mutex_init(3),
pthread_mutex_destroy(3),
pthread_mutex_lock(3),
pthread_mutex_trylock(3),
pthread_mutex_unlock(3)
The following group of functions is supported if
_POSIX_THREAD_PRIO_PROTECT options is defined:
pthread_mutexattr_setprotocol(3)
pthread_mutexattr_getprotocol(3)
pthread_mutexattr_setprioceiling(3)
pthread_mutexattr_getprioceiling(3)
pthread_mutex_setprioceiling(3)
pthread_mutex_getprioceiling(3)
POSIX condition variables:
pthread_condattr_getpshared(3),
pthread_condattr_setpshared(3),
pthread_condattr_init(3),
pthread_condattr_destroy(3),
pthread_cond_init(3),
pthread_cond_destroy(3),
pthread_cond_wait(3),
pthread_cond_timedwait(3),
pthread_cond_broadcast(3),
pthread_cond_signal(3),
sem_init(3),
sem_destroy(3),
sem_getvalue(3),
sem_wait(3),
sem_trywait(3),
sem_post(3),
sem_timedwait(3)
pthread_spin_init(3),
pthread_spin_destroy(3),
pthread_spin_lock(3),
pthread_spin_trylock(3),
pthread_spin_unlock(3),
sysconf(3),
uname(2)
Many of these functions are described, for example, in the Single UNIX
Specification, Version 2
(http://www.opengroup.org/onlinepubs/7908799/index.html).
Most Linux distributions contain man pages for these functions as
implemented by the LinuxThreads library. You can try man 3
pthread_create, for example.
POSIX options supported (incomplete list):
_POSIX_TIMEOUTS
_POSIX_SPIN_LOCKS
_POSIX_SEMAPHORES
Non-portable POSIX extensions:
Manual pages for these functions can be found in the rtl/man directory.
The include/rtl_sched.h file contains declarations of these and other related
functions and types.
pthread_attr_setcpu_np -- assign the created thread to a particular CPU
pthread_attr_getcpu_np
pthread_wait_np -- suspend the execution of the calling thread until the next period
(for periodic tasks). pthread_wait_np is a cancellation point.
pthread_delete_np -- delete the thread.
pthread_attr_setfp_np -- mark the created thread as using or not using the FPU
pthread_setfp_np -- mark the thread as using or not using the FPU
pthread_make_periodic_np (pthread_t p, hrtime_t start, hrtime_t period)
set timing parameters for periodic threads
pthread_suspend_np() -- suspend the execution of the calling thread.
pthread_suspend_np(pthread_self()) is a cancellation point.
pthread_wakeup_np (pthread_t thread) -- wake up the thread
A possible use of these functions is demonstrated in the example programs.
There are manual pages for these and other functions in the rtl/man directory.
Notes:
pthread_create must only be called from Linux (i.e., not from
RT-threads).
TODO
sigemptyset, sigfillset, sigaddset, sigdelset, sigismember (3)
|