1 / 47
文档名称:

分布式系统设计.03.pdf

格式:pdf   大小:166KB   页数:47页
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

分布式系统设计.03.pdf

上传人:wxc6688 2022/6/21 文件大小:166 KB

下载得到文件列表

分布式系统设计.03.pdf

相关文档

文档介绍

文档介绍:: .
Distributed Systters and memory, used for the execution of a series of
instructions (., processor context, state).
Process context: The minimal collection of values stored in
registers and memory, used for the execution of a thread (.,
thread context, but now also at least MMU register values).
4 / 36Processes Threads
Context Switching
Observations
1 Threads share the same address space. Thread context switching
can be done entirely independent of the operating system.
2 Process switching is generally more expensive as it involves
getting the OS in the loop, ., trapping to the kernel.
3 Creating and destroying threads is much cheaper than doing so
for processes.
5 / 36Processes Threads
Threads and Operating Systems
Main issue
Should an OS kernel provide threads, or should they be implemented as
user-level packages?
User-space solution
All operations can be completely handled within a single process ⇒
implementations can be extremely efficient.
All services provided by the kernel are done on behalf of the process in
which a thread resides ⇒ if the kernel decides to block a thread, the
entire process will be blocked.
Threads are used when there are lots of external events: threads block
on a per-event basis ⇒ if the kernel can’t distinguish threads, how can it
support signaling events to them?
6 / 36Processes Threads
Threads and Operating Systems
Kernel solution
The whole idea is to have the kernel contain the implementation of a thread
package. This means that all operations return as system calls
Operat