作者gecer (gecer)
看板Programming
標題[問題] multithread 問題
時間Sun Aug 4 21:09:33 2019
若僅有一個 cpu programing的multithread 是否實際上一次僅執行一個 thread??
譬如openMP
#pragma omp parallel num_threads(3) 會有三個threads 一個CPU 是否真的同時處理
三
個threads? 或是實際上3個thread輪流處理?
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 36.237.105.82 (臺灣)
※ 文章網址: https://webptt.com/m.aspx?n=bbs/Programming/M.1564924175.A.6C3.html
1F:推 CoNsTaR: Intel 處理器有 Hyper-Threads192.197.88.89 08/05 17:18
2F:→ admon: 一核會對應一個thread, 細節不談122.116.228.28 08/06 23:50
如果只有一核 核會在thread間context switch?輪流處理?
※ 編輯: gecer (36.237.105.82 臺灣), 08/07/2019 20:57:52
3F:→ admon: 一核一次只能跑一隻thread, OS multitaskin 122.116.228.28 08/07 21:42
4F:→ admon: g. 122.116.228.28 08/07 21:42
5F:推 popcorny: 單核可以 multithread,會 context swit 36.224.51.225 08/10 18:44
6F:→ popcorny: ch 輪流處理 36.224.51.225 08/10 18:44