看板 Grad-ProbAsk 關於我們 聯絡資訊
※ 引述《svanavs (svanavs)》之銘言: : ※ 引述《work76 (work)》之銘言: : : describe the action taken by a kernel to context switch between the floowing : : and point out the difference among them: : : 1.processes : : 2.user-level threads : : 3.kernel-level threads 請問如果答案這樣回ok嗎? 1.processes: context switch負担重 2.thread: context switch負担輕 3.user-level threads: 和kernel不會介入,只看的到一個行程,不會知道user thread 4.kernel-level threads: kernel可將一行程內thread放至不同cpu上平執行 =>一群thread是一個行程的一部份,kernel進行context switch至另一個行程,必需將行 程中正在執行的thread之相關資訊回存起來(pc, register set, stack),再根據下一個 行程的PCB找出要載入的thread之相關資訊,伴隨之行程的程式區段、檔案指標和memory 配置等都要隨之更新。 -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.137.26.219