processes - Processes...

Info iconThis preview shows pages 1–11. Sign up to view the full content.

View Full Document Right Arrow Icon
Processes http://net.pku.edu.cn/~course/cs501/2011 Hongfei Yan School of EECS, Peking University 3/16/2011
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Contents Chapter 01: Introduction 02: Architectures 03: Processes 04: Communication 05: Naming 06: Synchronization 08: Fault Tolerance 09: Security 10: Distributed Object-Based Systems 11: Distributed File Systems 12: Distributed Web-Based Systems 13: Distributed Coordination-Based Systems 2/N
Background image of page 2
03: Processes 3.1 Threads 3.2 Virtualization 3.3 Clients 3.4 Servers 3.5 Code Migration 3/N
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
4/N 3.1 Threads 3.1.1 Introduction to Threads 3.1.2 Threads in Distributed Systems
Background image of page 4
Basic ideas 5/N We build virtual processors in software, on top of physical processors: Processor : Provides a set of instructions along with the capability of automatically executing a series of those instructions. Thread : A minimal software processor in whose context a series of instructions can be executed. Saving a thread context implies stopping the current execution and saving all the data needed to continue the execution at a later stage. Process : A software processor in whose context one or more threads may be executed. Executing a thread, means executing a series of instructions in the context of that thread.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Context Switching 6/N Processor context : The minimal collection of values stored in the registers of a processor used for the execution of a series of instructions (e.g., stack pointer, addressing registers, program counter). Thread context : The minimal collection of values stored in registers and memory, used for the execution of a series of instructions (i.e., processor context, state). Process context : The minimal collection of values stored in registers and memory, used for the execution of a thread (i.e., thread context, but now also at least MMU register values).
Background image of page 6
7/N Observation 1 : Threads share the same address space. Do we need OS involvement? Observation 2 : Process switching is generally more expensive. OS is involved. e.g., trapping to the kernel. Observation 3 : Creating and destroying threads is cheaper than doing it for a process.
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
8/N Context Switching in Large Apps A large app is commonly a set of cooperating processes, communicating via IPC, which is expensive.
Background image of page 8
9/N Threads and OS (1/2) Main Issue : Should an OS kernel provide threads or should they be implemented as part of a user-level package? User-space solution : Nothing to do with the kernel. Can be very efficient. But everything done by a thread affects the whole process. So what happens when a thread blocks on a syscall? Can we use multiple CPUs/cores?
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Threads and OS (2/2) 10/N Kernel solution: Kernel implements threads. Everything is system call. Operations that block a thread are no longer a
Background image of page 10
Image of page 11
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 06/24/2011.

Page1 / 70

processes - Processes...

This preview shows document pages 1 - 11. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online