Silphireの日記: pthread日記(79) - pthread_setconcurrency()
日記 by
Silphire
同時並列性レベルを設定します
int pthread_setconcurrency(int new_level);
pthread_setconcurrency()は、システムに同時並列性レベルをnew_levelにするように要求します。必ずしも要求した値通りになるわけでは無く、pthread_setconcurrency()を呼び出した結果、同時並列性レベルがいくつになるかは分かりません。システムは、pthread_setconcurrency()で与えられた値を「参考値」として扱います。
new_levelが0だった場合、システムは同時並列性レベルをデフォルトの値に戻します。結果として動じ並列性レベルはpthread_setconcurrency()が1度も呼ばれていない状態の値になります。
実装がカーネルレベルのスケジューリング上での多重化したスレッドをサポートしていない場合、pthread_setconcurrency()とpthread_getconcurrency()はソースコードの互換性の観点からこの関数を実装する必要はありますが、実行してもシステムに何も及ぼさないようにすべきです。さらに言うならば、pthread_setconcurrency()の後のpthread_getconcurrency()の呼び出しの為に、new_levelを保存しておく事が望まれます。
pthread_setconcurrency()が成功した時には0を返します。エラーの時はエラーに応じた値を返します。
pthread日記(79) - pthread_setconcurrency() More ログイン