-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

Mastering Embedded Linux Development
By :

The programming interface for threads is the POSIX threads API, which was first defined in the IEEE POSIX 1003.1c standard (1995) and is commonly known as pthreads. It is implemented as an additional part of the libpthread.so.0
C library. There have been two implementations of pthreads
over the last 20 years or so: LinuxThreads and Native POSIX Thread Library (NPTL). The latter is much more compliant with the specification, especially in regard to the handling of signals and process IDs. NPTL is dominant now. If you happen to come across any C standard library that still employs LinuxThreads
, I would refrain from using it.
The function you can use to create a thread is pthread_create(3)
:
int pthread_create(pthread_t *restrict thread, const pthread_attr_t *restrict attr, typeof(void *(void *)) *start_routine, void *restrict arg);
It creates a new thread of execution that begins in the start_routine
function and places a descriptor in pthread_t...