Top/Lang/C++/C++11/thread

目次

初めに

std::thread

thread の作成

thread 終了を待機する

thread を手放す

thread の識別

現在の thread の処理を明け渡す

void std::yield() noexcept;

現在の thread をスリープする

並行実行できる thread の数を取得する

thread を排他制御する

リソースのロックを管理する

std::lock_guard

#include <mutex>

std::unique_lock

複数のリソースをロックする

ロックせずに吐いたアクセスする

スレッドセーフに1度だけ関数を呼び出す

条件変数を使用する

thread をまたいで値や例外を受け渡す

std::promise --- 他のスレッドに渡す値や例外を設定する

std::future --- 他のスレッドからセットされた値や例外を取り出す

非同期処理をする

スレッドローカル変数を使用する


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS