POSIX: Difference between revisions
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
* [https://computing.llnl.gov/tutorials/pthreads/ POSIX Threads Programming], excellent introduction to pthreads, by Blaise Barney, at Lawrence Livermore National Laboratory. |
* [https://computing.llnl.gov/tutorials/pthreads/ POSIX Threads Programming], excellent introduction to pthreads, by Blaise Barney, at Lawrence Livermore National Laboratory. |
||
* [http://www.advancedlinuxprogramming.com/alp-folder/alp-ch04-threads.pdf Advanced Linux Programming Ch 4 — Threads] |
|||
* [http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html POSIX thread (pthread) libraries] |
* [http://www.yolinux.com/TUTORIALS/LinuxTutorialPosixThreads.html POSIX thread (pthread) libraries] |
||
* [http://en.wikipedia.org/wiki/POSIX_Threads POSIX Threads] (wikipedia) |
* [http://en.wikipedia.org/wiki/POSIX_Threads POSIX Threads] (wikipedia) |
Revision as of 17:01, 31 October 2012
PThreads
General Information
Links:
- POSIX Threads Programming, excellent introduction to pthreads, by Blaise Barney, at Lawrence Livermore National Laboratory.
- Advanced Linux Programming Ch 4 — Threads
- 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.