推 work76:謝謝你,翻的很容易了解 09/28 20:11
※ 引述《work76 (work)》之銘言:
: 可以請問一下,關於多執行緒在恐龍書上,有幾行沒有很了解他的意思,是否有人可以幫
: 忙解釋一下,謝謝。
: Assuming that the threads are part of the same larger process, the kernel
: needs to write the program counter, register set and stack of the outgoing
: thread to a backing store, and switch to point to the PCB of the incoming
: thread (to look at the new values in the PC, register and stack).
: when performing a context switch between processes, we must update additional
: information including the code block, the file pointers, the memory.
一群 threads 是一個 process 中的一部份 , Kernel 想若進行 context switch
到其他 processes , 就必須先將原本 process 中正在執行的 thread 的相關資訊
(PC , RegSet , Stack)回存起來 , 根據下一個 process 的 PCB 找出要載入的
thread 的相關資訊(PC , RegSet , Stack)進行載入 , 伴隨著這個 process 所屬的
程式區段 , 檔案指標 , 記憶體配置 都要隨之更新
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.115.222.93