Namespaces
Variants
Views
Actions

Thread support library [[:Template:mark c++0x]]

From cppreference.com
< cpp
Revision as of 10:28, 16 July 2011 by P12 (Talk | contribs)

Template:cpp/thread/sidebar

The standard thread support library provides portable way to construct threads and to manage them.

Contents

Threads

Threads enable the program to execute across several processor cores.

Defined in header <thread>
manages a separate thread
(class)
Functions managing current thread
Defined in namespace this_thread
hints the implementation to reschedule execution of threads
(function)
returns the thread id of the current thread
(function)
stops the execution of the current thread for a specified time duration
(function)
stops the execution of the current thread until a specified time point
(function)

Mutual exclusion

Several classes are provided that manage mutexes: mutex, recursive_mutex, timed_mutex, recursive_timed_mutex.

Several class templates are provided for generic mutex management: lock_guard, unique_lock.

once_flag

Several helper functions are provided for mutex locking:

Defined in header <mutex>
tries to lock specified mutexes or locks, returns if at least one is unavailable
(function)
locks specified mutexes/locks, blocks if at least one is unavailable
(function)

(function)

Condition variables

Futures