IPCSynchJan29

IPCSynchJan29 - InterProcessCommunication...

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

View Full Document Right Arrow Icon
10/16/10 Page 1 Inter-Process Communication  and Synchronization B. Ramamurthy
Background image of page 1

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

View Full DocumentRight Arrow Icon
10/16/10 Page 2 Introduction An important and fundamental feature in modern  operating systems is concurrent execution of  processes/threads. This feature is essential for the  realization of multiprogramming, multiprocessing,  distributed systems, and client-server model of  computation. Concurrency encompasses many design issues  including communication and synchronization  among processes, sharing of and contention for  resources. In this discussion we will look at the various design  issues/problems and the wide variety of solutions  available.
Background image of page 2
10/16/10 Page 3 Topics for discussion The principles of concurrency Interactions among processes Mutual exclusion problem Mutual exclusion- solutions Software approaches (Dekker’s and Peterson’s) Hardware support (test and set atomic operation) OS solution (semaphores) PL solution (monitors) Distributed OS solution ( message passing) Reader/writer problem Dining Philosophers Problem
Background image of page 3

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

View Full DocumentRight Arrow Icon
10/16/10 Page 4 Principles of Concurrency Interleaving and overlapping the execution of  processes. Consider two processes P1 and P2 executing  the function  echo : {   input (in, keyboard);   out = in;   output (out, display); }
Background image of page 4
10/16/10 Page 5 ...Concurrency (contd.) P1 invokes  echo,  after it inputs into  in  , gets interrupted (switched).  P2 invokes  echo , inputs into  in  and completes the execution and  exits. When P1 returns in is overwritten and gone. Result: first ch is  lost and second ch is written twice. This type of situation is even more probable in multiprocessing  systems where real concurrency is realizable thru’ multiple  processes executing on multiple processors. Solution: Controlled access to shared resource Protect the shared resource :  in  buffer;  “critical resource” one process/shared code. “critical region”
Background image of page 5

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

View Full DocumentRight Arrow Icon
10/16/10 Page 6 Interactions among processes In a multi-process application these are the various degrees of  interaction: 1. Competing processes :  Processes themselves do not share  anything. But OS has to share the system resources among  these processes  “competing” for system resources such as  disk, file or printer. Co-operating processes  : Results of one or more processes may  be needed for another process.  2.     Co-operation by sharing  : Example: Sharing of an IO buffer. Concept of  critical section. (indirect) 3.      Co-operation by communication  : Example: typically no data sharing,  but co-ordination thru’ synchronization becomes essential in certain  applications. (direct)
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This document was uploaded on 10/15/2010.

Page1 / 44

IPCSynchJan29 - InterProcessCommunication...

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

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