A7_ProcessesCH3 - Processes, Threads and Virtualization...

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

View Full Document Right Arrow Icon
1 Processes, Threads and Virtualization Chapter 3.1-3.2 The role of processes in distributed systems
Background image of page 1

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

View Full DocumentRight Arrow Icon
2 Introduction To be efficient, a client/server system can use asynchronous communication to overlap communication latencies with local processing. Structure processes with multiple threads Virtual machines make it possible for multiple servers to execute securely on a single platform, and to migrate servers from one platform to another. Process migration?
Background image of page 2
3 3.1.1 Concurrency Transparency Traditionally, operating systems used the process concept to provide concurrency transparency to executing processes. Process isolation; virtual processors; hardware support Today, multithreading provides concurrency with less overhead (so better performance) Also less transparency – application must provide memory protection for threads.
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 Large Applications Early operating systems (e.g., UNIX) Supported large apps by supporting the development of several cooperating programs via fork( ) system call (Parent process fork s multiple child processes) Rely on IPC mechanisms to exchange info Pipes, message queues, shared memory Overhead: numerous context switches Possible benefits of multiple threads v multiple programs (processes) Less communication overhead Easier to handle asynchronous events Easier to handle priority scheduling
Background image of page 4
5 Forking a New Process http://www.yolinux.com/TUTORIALS/ForkExecProcesses.htm http://www.amparo.net/ce155/fork-ex.html http://www.amparo.net/ce155/fork-ex.html
Background image of page 5

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

View Full DocumentRight Arrow Icon
6 Thread Conceptually, one of (possibly several) concurrent execution paths contained in a process. If two processes want to share data or other resources, the OS must be involved. Overhead: system calls, mode switches, context switches, extra execution time. Two threads in a single process can share global data automatically – as easily as two functions in a single process OS protects processes from one another; not so for threads within a single process.
Background image of page 6
7 Threads – Revisited Multithreading is useful in the following kinds of situations: To allow a program to do I/O and computations at the “same” time: one thread blocks to wait for input, others can continue to execute To allow separate threads in a program to be distributed across several processors in a shared memory multiprocessor To allow a large application to be structured as cooperating threads, rather than cooperating processes (avoiding excess context switches) Multithreading also can simplify program development (divide-and-conquer)
Background image of page 7

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

View Full DocumentRight Arrow Icon
Overhead Due to Process Switching Figure 3-1. Context switching as the result of IPC. Save CPU context
Background image of page 8
Image of page 9
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/14/2011 for the course CS 690 taught by Professor Staff during the Fall '11 term at University of Alabama - Huntsville.

Page1 / 58

A7_ProcessesCH3 - Processes, Threads and Virtualization...

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

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