作者svanavs (svanavs)
看板Grad-ProbAsk
标题Re: [理工] [OS]-多执行绪的问题
时间Mon Sep 28 18:08:43 2009
※ 引述《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
1F:推 work76:谢谢你,翻的很容易了解 09/28 20:11