+
CLRS Chapter 15-26
読んだ。Chapter27から選択的トピック。
CLRS Chapter 27 Multithreaded Algorithms
Multithreaded Algorithmsまで辿りついたので、オライリーの『並行コンピューティング技法』も買ってきて一緒に読み始めた。
並行コンピューティング技法 ―実践マルチコア/マルチスレッドプログラミング
- 作者: Clay Breshears,千住治郎
- 出版社/メーカー: オライリージャパン
- 発売日: 2009/12/21
- メディア: 大型本
- 購入: 12人 クリック: 598回
- この商品を含むブログ (38件) を見る
#include <omp.h> #include <stdio.h> int main(){ int i; #pragma omp parallel for for(i = 0; i < 2000; i++) { printf("%d %d\n", i, omp_get_thread_num()); } }
実行結果
0 0 1 0 2 0 . . . 1060 1 250 0 1061 1 251 0 1062 1 252 0 . . .