Before you get started with Pthreads
Many details in Multithreaded applications will affect your interpretation of how the Pthread APIs work. Multithreaded applications also contains important general information about threads. The information includes how process architecture and process behavior change when running a threaded program, what parts of the system are not available for use when running a threaded program, and tips on performance and debugging of threaded jobs.
Programming with Pthreads
- Pthread concepts and references
- What are Pthreads?
- Primitive data types -- Naming conventions for primitive data types in threaded programs.
- Feature test macros -- Descriptions of supported and unsupported feature test macros.
- OS/400 Pthreads versus other threads implementations
- Header files for Pthread functions
- Pthread glossary -- Definitions of some common Pthread terms.
- Other sources of Pthread information
- Pthread programming basic tasks -- Information to get you started with Pthreads programming.
- Troubleshooting Pthread errors -- Descriptions of common errors users encounter when programming with Pthreads.
Pthread APIs
For information about the examples included with the APIs, see the Information on the Pthread API examples. See Code disclaimer information for information pertaining to code examples.
For information about specific groups of Pthread APIs, see:
- Thread management APIs
- Thread specific storage APIs
- Thread cancellation APIs
- Mutex synchronization API
- Condition variable synchronization APIs
- Read/write lock synchronization APIs
- Signals APIs
- Unsupported Pthread APIs
The Pthread APIs are:
- pthread_atfork()--Register Fork Handlers
- pthread_atfork_np()--Register Fork Handlers with Extended Options
- pthread_attr_destroy()--Destroy Thread Attributes Object
- pthread_attr_getdetachstate()--Get Thread Attributes Object Detachstate
- pthread_attr_getguardsize()--Get Guard Size
- pthread_attr_getinheritsched()--Get Thread Attribute Object Inherit Scheduling Attributes
- pthread_attr_getschedparam()--Get Thread Attributes Object Scheduling Parameters
- pthread_attr_getschedpolicy()--Get Scheduling Policy
- pthread_attr_getscope()--Get Scheduling Scope
- pthread_attr_getstackaddr()--Get Stack Address
- pthread_attr_getstacksize()--Get Stack Size
- pthread_attr_init()--Initialize Thread Attributes Object
- pthread_attr_setdetachstate()--Set Thread Attributes Object Detachstate
- pthread_attr_setguardsize()--Set Guard Size
- pthread_attr_setinheritsched()--Set Thread Attribute Inherit Scheduling Attributes
- pthread_attr_setschedparam()--Set Thread Attributes Object Scheduling Parameters
- pthread_attr_setschedpolicy()--Set Scheduling Policy
- pthread_attr_setscope()--Set Scheduling Scope
- pthread_attr_setstackaddr()--Set Stack Address
- pthread_attr_setstacksize()--Set Stack Size
- pthread_cancel()--Cancel Thread
- pthread_cleanup_peek_np()--Copy Cleanup Handler from Cancellation Cleanup Stack
- pthread_cleanup_pop()--Pop Cleanup Handler off of Cancellation Cleanup Stack
- pthread_cleanup_push()--Push Cleanup Handler onto Cancellation Cleanup Stack
- pthread_clear_exit_np()--Clear Exit Status of Thread
- pthread_cond_broadcast()--Broadcast Condition to All Waiting Threads
- pthread_cond_destroy()--Destroy Condition Variable
- pthread_cond_init()--Initialize Condition Variable
- pthread_cond_signal()--Signal Condition to One Waiting Thread
- pthread_cond_timedwait()--Timed Wait for Condition
- pthread_cond_wait()--Wait for Condition
- pthread_condattr_destroy()--Destroy Condition Variable Attributes Object
- pthread_condattr_init()--Initialize Condition Variable Attributes Object
- pthread_condattr_getpshared()--Get Process Shared Attribute from Condition Attributes Object
- pthread_condattr_setpshared()--Set Process Shared Attribute in Condition Attributes Object
- pthread_create()--Create Thread
- pthread_delay_np()--Delay Thread for Requested Interval
- pthread_detach()--Detach Thread
- pthread_equal()--Compare Two Threads
- pthread_exit()--Terminate Calling Thread
- pthread_extendedjoin_np()--Wait for Thread with Extended Options
- pthread_get_expiration_np()--Get Condition Expiration Time from Relative Time
- pthread_getcancelstate_np()--Get Cancel State
- pthread_getconcurrency()--Get Process Concurrency Level
- pthread_getpthreadoption_np()--Get Pthread Run-Time Option Data
- pthread_getschedparam()--Get Thread Scheduling Parameters
- pthread_getspecific()--Get Thread Local Storage Value by Key
- pthread_getthreadid_np()--Retrieve Unique ID for Calling Thread
- pthread_getunique_np()--Retrieve Unique ID for Target Thread
- pthread_is_initialthread_np()--Check if Running in the Initial Thread
- pthread_is_multithreaded_np()--Check Current Number of Threads
- pthread_join()--Wait for and Detach Thread
- pthread_join_np()--Wait for Thread to End
- pthread_key_create()--Create Thread Local Storage Key
- pthread_key_delete()--Delete Thread Local Storage Key
- pthread_kill()--Send Signal to Thread
- pthread_lock_global_np()--Lock Global Mutex
- pthread_mutex_destroy()--Destroy Mutex
- pthread_mutex_getprioceiling()--Get Mutex Priority Ceiling
- pthread_mutex_init()--Initialize Mutex
- pthread_mutex_lock()--Lock Mutex
- pthread_mutex_setprioceiling()--Set Mutex Priority Ceiling
- pthread_mutex_timedlock_np()--Lock Mutex with Time-Out
- pthread_mutex_trylock()--Lock Mutex with No Wait
- pthread_mutex_unlock()--Unlock Mutex
- pthread_mutexattr_destroy()--Destroy Mutex Attributes Object
- pthread_mutexattr_getkind_np()--Get Mutex Kind Attribute
- pthread_mutexattr_getname_np()--Get Name from Mutex Attributes Object
- pthread_mutexattr_getprioceiling()--Get Mutex Priority Ceiling Attribute
- pthread_mutexattr_getprotocol()--Get Mutex Protocol Attribute
- pthread_mutexattr_getpshared()--Get Process Shared Attribute from Mutex Attributes Object
- pthread_mutexattr_gettype()--Get Mutex Type Attribute
- pthread_mutexattr_init()--Initialize Mutex Attributes Object
- pthread_mutexattr_setkind_np()--Get Mutex Kind Attribute
- pthread_mutexattr_setname_np()--Set Name in Mutex Attributes Object
- pthread_mutexattr_setprioceiling()--Set Mutex Priority Ceiling Attribute
- pthread_mutexattr_setprotocol()--Set Mutex Protocol Attribute
- pthread_mutexattr_setpshared()--Set Process Shared Attribute in Mutex Attributes Object
- pthread_mutexattr_settype()--Set Mutex Type Attribute
- pthread_once()--Perform One-Time Initialization
- pthread_rwlock_destroy()--Destroy Read/Write Lock
- pthread_rwlock_init()--Initialize Read/Write Lock
- pthread_rwlock_rdlock()--Get Shared Read Lock
- pthread_rwlock_timedrdlock_np()--Get Shared Read Lock with Time-Out
- pthread_rwlock_timedwrlock_np()--Get Exclusive Write Lock with Time-Out
- pthread_rwlock_tryrdlock()--Get Shared Read Lock with No Wait
- pthread_rwlock_trywrlock()--Get Exclusive Write Lock with No Wait
- pthread_rwlock_unlock()--Unlock Exclusive Write or Shared Read Lock
- pthread_rwlock_wrlock()--Get Exclusive Write Lock
- pthread_rwlockattr_destroy()--Destroy Read/Write Lock Attribute
- pthread_rwlockattr_getpshared()--Get Pshared Read/Write Lock Attribute
- pthread_rwlockattr_init()--Initialize Read/Write Lock Attribute
- pthread_rwlockattr_setpshared()--Set Pshared Read/Write Lock Attribute
- pthread_self()--Get Pthread Handle
- pthread_set_mutexattr_default_np()--Set Default Mutex Attributes Object Kind Attribute
- pthread_setcancelstate()--Set Cancel State
- pthread_setcanceltype()--Set Cancel Type
- pthread_setconcurrency()--Set Process Concurrency Level
- pthread_setpthreadoption_np()--Set Pthread Run-Time Option Data
- pthread_setschedparam()--Set Target Thread Scheduling Parameters
- pthread_setspecific()--Set Thread Local Storage by Key
- pthread_sigmask()--Set or Get Signal Mask
- pthread_signal_to_cancel_np()--Convert Signals to Cancel Requests
- pthread_test_exit_np()--Test Thread Exit Status
- pthread_testcancel()--Create Cancellation Point
- pthread_trace_init_np()--Initialize or Reinitialize Pthread Tracing
- PTHREAD_TRACE_NP()--Macro to optionally execute code based on trace level
- pthread_unlock_global_np()--Unlock Global Mutex
- sched_yield()--Yield Processor to Another Thread