Chapter_4_-_Synchronization

Chapter_4_-_Synchronization - 4 Synchronization and...

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

View Full Document Right Arrow Icon
4 Process Synchronization 1 4 Synchronization and Interprocess Communication Further reading: Stallings Chapter 5 Silberschatz Chapter 6 Tanenbaum Chapter 2.3 Operating 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
4 Process Synchronization 2 Needs of Processes • Allocation of processor time • Allocation and sharing resources • Communication among processes • Synchronization of multiple processes Operating Systems
Background image of page 2
4 Process Synchronization 3 How can processes/threads exchange information shared memory – need to establish a region of shared memory – usually resides in the address space of a process – shared memory systems system calls are only needed to setup the memory – Basic operations: read/write message passing – send messages between processes – requires system calls to the OS for every message – often easier to realize for networked process communication – send/receive Operating Systems
Background image of page 3

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

View Full DocumentRight Arrow Icon
Shared Memory • Uniprocessor architecture and SMPs – Common Address Space to Physical Memory by hardware – Operating must provide appropriate memory management to processes or threads – Threads share resources within a process – Processes can share memory on shared memory segments • Can establish also shared memory for loosely coupled systems – Provide special middleware NUMA Distributed System Architectures • Performance depends –S y s t em b u s – Network characteristics 4 Process Synchronization 4 P Q Middleware Middleware OS Communica tion Layer Physical Layer Read/Write Address OS Communica tion Layer Physical Layer Channel / Bus / Network Operating Systems
Background image of page 4
4 Process Synchronization 5 Message Passing • No sharing of resources between processes needed • basic operations: send (destination, message): send a message receive (source,message): receive a message • Send/receive can be blocking non-blocking • Blocking send + blocking receive – tight coupling between processes • Non blocking send + blocking receive Operating Systems
Background image of page 5

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

View Full DocumentRight Arrow Icon
4 Process Synchronization 6 Direct communication Direct symmetric communication • Each process that wants to communicate must name the recipient: send (P, message) send a message to process P receive (Q, message) receive a message from process Q • Communication link established automatically • link associated exactly between two processes Direct asymmetric communication • Use instead send (P, message) send a message to process P receive (message) receive message from arbitrary process Operating Systems
Background image of page 6
4 Process Synchronization 7 Indirect communication Problem of Direct Addressing – changing a process identifier may impact all other process definitions – limited modularity Indirect addressing uses mailbox or port concept – Mailbox: Shared by multiple receiver – Port: Receiver Specific, e.g. WebServer uses port 80 send (A, message) send a message to mailbox/port named A receive (A, message) receive a message from mailbox A – link is only established if both members share a mailbox Operating Systems
Background image of page 7

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

View Full DocumentRight Arrow Icon
4 Process Synchronization 8 One-to-One • private communication link between two processes Operating Systems
Background image of page 8
4 Process Synchronization 9 Many-to-one • Client server interactions Operating Systems
Background image of page 9

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

View Full DocumentRight Arrow Icon
Image of page 10
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/15/2012 for the course CS 110 taught by Professor Boris during the Fall '11 term at HDM Stuttgart.

Page1 / 66

Chapter_4_-_Synchronization - 4 Synchronization and...

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

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