POSIX thread API

Source: Internet
Author: User
Tags posix unsupported
Document directory
  • Before you get started with pthreads
  • Pthread APIs
Before you get started with pthreads

Extends details in Multithreaded Applications will affect your interpretation of how the pthread APIs work.Multithreaded ApplicationsAlso contains important general information about threads. the information provided des 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.
    • Writing and compiling threaded programs
    • Running threaded programs
  • Troubleshooting pthread errors -- descriptions of Common Errors users encounter when programming with pthreads.
Pthread APIs

For information about the examples encoded with the APIS, see the information on the pthread API examples. See Code disclaimer imer 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.