分布式系统与管理chapter_Processes.pptVIP

  • 4
  • 0
  • 约2.87万字
  • 约 78页
  • 2015-08-15 发布于湖北
  • 举报
分布式系统与管理chapter_Processes.ppt

Distributed Systems Processes Yingchi Mao Outline Threads in distributed systems Virtualization Thin-client computing Servers Code migration Threads Introduction to Threads Threads in Distributed Systems What Is A Process? Broadly speaking, what is a process? Some notion of execution. Something that has a sequence of instructions, and changes the state of the system as a result of those instructions. Some notion of containment. A process is usually thought of as “owning” certain resources. A process has a set of instructions (the “program”). “A program in execution”. What is a thread then? Has a minimal execution context, but everything else belongs to the containing process. Context Switching Switch execution between caller and callee: The minimal collection of values stored in the registers of a processor. Switch execution between threads: The minimal collection of values stored in registers plus maybe some thread state. Switch between processes: Thread context plus address space values. Observation 1: Threads share the same address space. Observation 2: Process switching is generally more expensive. OS is involved. Observation 3: Creating and destroying threads is cheaper than doing it for a process. Context Switching in Large Apps A large app is commonly a set of cooperating processes, communicating via IPC, which is expensive. Why use threads? Do multiple things at once, like maintain responsiveness. Easier to structure Do we have to use threads? Why not processes? How do you do multiple things at once? Why prefer processes to threads? Take advantage of multicores Processes and threads Processes offer concurrency transparency, but at a relatively high price on performance Threads offer concurrency without much less transparency Applications with better performance that are harder to code/debug Advantages of multithreading No need to block with every system call Easy to exploit available parallelism in multiprocessors Cheaper communication between

文档评论(0)

1亿VIP精品文档

相关文档