Thread support library
![]() |
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
C++ includes built-in support for threads, mutual exclusion, condition variables, and futures.
目次 |
[編集] スレッド
Threads enable programs to execute across several processor cores.
Defined in header
<thread> | |
(C++11) |
別のスレッドを管理します Original: manages a separate thread The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラス) |
Functions managing the current thread | |
Defined in namespace
this_thread | |
(C++11) |
suggests that the implementation reschedule execution of threads (機能) |
(C++11) |
現在のスレッドのスレッドIDを返します Original: returns the thread id of the current thread The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) |
(C++11) |
指定した時間のために、現在のスレッドの実行を停止します Original: stops the execution of the current thread for a specified time duration The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) |
(C++11) |
stops the execution of the current thread until a specified time point (機能) |
[編集] 相互排除
Mutual exclusion algorithms prevent multiple threads from simultaneously accessing shared resources. This prevents data races and provides support for synchronization between threads.
Defined in header
<mutex> | |
(C++11) |
基本的な相互排他機能を提供しています Original: provides basic mutual exclusion facility The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラス) |
(C++11) |
タイムアウトでロックを実装する相互排除施設が用意されています Original: provides mutual exclusion facility which implements locking with a timeout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラス) |
(C++11) |
同じスレッドによって再帰的にロックすることができ、相互排他機能を提供しています Original: provides mutual exclusion facility which can be locked recursively by the same thread The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラス) |
(C++11) |
同じスレッドによってrecursively ロックすることができます相互排除施設を提供し、タイムアウトでロックが実装されています Original: provides mutual exclusion facility which can be locked recursively by the same thread and implements locking with a timeout The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラス) |
Generic mutex management | |
(C++11) |
厳密スコープベースのミューテックスの所有権のラッパーを実装します Original: implements a strictly scope-based mutex ownership wrapper The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) |
(C++11) |
可動ミューテックスの所有権のラッパーを実装します Original: implements movable mutex ownership wrapper The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) |
ロック·ストラテジーを指定するために使用されるタグの種類 Original: tag type used to specify locking strategy The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラス) | |
タグの定数は、ロック方法を指定するために使用します Original: tag constants used to specify locking strategy The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (定数) | |
Generic locking algorithms | |
(C++11) |
try_lock に繰り返し呼び出しを介してミューテックスの所有権を取得しようとします Original: attempts to obtain ownership of mutexes via repeated calls to try_lock The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) |
(C++11) |
指定されたミューテックスをロックして、もしあればブロックは使用できません Original: locks specified mutexes, blocks if any are unavailable The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) |
Original: Call once The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. | |
(C++11) |
call_onceは一度だけ関数を呼び出していることを確認するためのヘルパーオブジェクト Original: helper object to ensure that call_once invokes the function only once The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラス) |
(C++11) |
この関数は、複数のスレッドから呼び出される場合であっても一度だけ呼び出します Original: invokes a function only once even if called from multiple threads The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) |
[編集] 条件変数
A condition variable is a synchronization primitive that allows multiple threads to communicate with eachother. It allows some number of threads to wait (possibly with a timeout) for notification from another thread that they may proceed. A condition variable is always associated with a mutex.
Defined in header
<condition_variable> | |
(C++11) |
provides a condition variable associated with a std::unique_lock (クラス) |
(C++11) |
provides a condition variable associated with any lock type (クラス) |
(C++11) |
schedules a call to notify_all to be invoked when this thread is completely finished (機能) |
(C++11) |
lists the possible results of timed waits on condition variables (列挙) |
[編集] 先物
The standard library provides facilities to obtain values that are returned and to catch exceptions that are thrown by asynchronous tasks (i.e. functions launched in separate threads). These values are communicated in a shared state, in which the asynchronous task may write its return value or store an exception, and which may be examined, waited for, and otherwise manipulated by other threads that hold instances of std::future or std::shared_future that reference that shared state.
Defined in header
<future> | |
(C++11) |
非同期検索のための値を格納します Original: stores a value for asynchronous retrieval The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) |
(C++11) |
非同期検索のために、その戻り値を格納するための機能をパッケージ化します Original: packages a function to store its return value for asynchronous retrieval The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) |
(C++11) |
非同期で設定された値を待ちます Original: waits for a value that is set asynchronously The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) |
(C++11) |
非同期で設定された値(おそらく他の先物によって参照される)のを待ちます Original: waits for a value (possibly referenced by other futures) that is set asynchronously The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラステンプレート) |
(C++11) |
非同期関数を実行します(潜在的に新しいスレッドで)、その結果を保持するstd::futureを返します Original: runs a function asynchronously (potentially in a new thread) and returns a std::future that will hold the result The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (関数テンプレート) |
(C++11) |
std::asyncための起動ポリシーを指定します Original: specifies the launch policy for std::async The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (列挙) |
(C++11) |
std::futureとstd::shared_futureで実行を待つ時限の結果を指定します Original: specifies the results of timed waits performed on std::future and std::shared_future The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (列挙) |
Future errors | |
(C++11) |
先物又は約束に関連したエラーを報告します Original: reports an error related to futures or promises The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (クラス) |
(C++11) |
将来のエラー·カテゴリを識別します Original: identifies the future error category The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (機能) |
(C++11) |
将来のエラー·コードを識別します Original: identifies the future error codes The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (列挙) |