IBM i Pthreads versus the POSIX standard, the Single UNIX Specification, and other threads implementations
Although the Pthread interfaces described in this document are based on a subset of the APIs defined in the POSIX standard and the Single UNIX® Specification, the implementation of these APIs is not compliant with these standards. This means that applications written in other versions of threads are not necessarily portable to IBM i. Below is a list of the differences between the Pthread APIs and other threads implementations.
- All thread definitions in pthread.h
- Unsupported preprocessor and feature test macros
- Unsupported Pthread APIs
- Unsupported constants
- Unsupported cancellation points
- Unsupported sysconf() configuration variables
- Thread priority and scheduling
- Thread ID vs. Pthread Handle (pthread_t)
- Thread ID value and size
- Mutexes return EDEADLK when re-locked by owner
- Return values from thread start routines are not integers
- Threads do not necessarily start before pthread_create() returns
- Initial thread is special, cannot pthread_exit()
- Pthread APIs cause asynchronous signals initialization
- Not all jobs can create threads; pthread_create() fails with EBUSY
- Read/write locks are recursive
- Shared read/write locks are released at thread termination
- Read/write locks can be upgraded / downgraded
- Read/write locks do not favor writers
- Spawn API provides more POSIX-like process model
- C++ destructors and Pthread termination
- Unhandled exceptions terminate the thread (not the process)
- Exceptions vs. Asynchronous signals vs. ANSI C signals
- Mutexes can be named to aid in application debug
[ Back to top | Pthread APIs | APIs by category ]