POSIX
Jump to navigation
Jump to search
PThreads
General Information
Links:
- POSIX Threads Programming, excellent introduction to pthreads, by Blaise Barney, at Lawrence Livermore National Laboratory.
- POSIX thread (pthread) libraries
- POSIX Threads (wikipedia)
- Advices
- For portability, always create joinable or detachable threads by setting explicitly the thread attribute (using
pthread_attr_getdetachstate
). This provides portability as not all implementations may create threads as joinable by default.
Thread-Local Data
- Using thread-specific data area foreseen by POSIX, which requires first creating a key that is later used to set or get thread-specific data attached to that key (see Advanced Linux Programming - Ch 4)
- Using keyword __thread, see http://www.akkadia.org/drepper/tls.pdf (not available in all compiler, not standard C99 [1]).
Debugging
See Debugging page.