6.Process_Synchronization - Process Synchronization Mehdi...

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

View Full Document Right Arrow Icon
Process Synchronization Mehdi Kargahi School of ECE University of Tehran Spring 2008
Background image of page 1

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

View Full DocumentRight Arrow Icon
M. Kargahi (School of ECE) Producer-Consumer (Bounded Buffer) s Producer s Consumer
Background image of page 2
M. Kargahi (School of ECE) Race Condition s Producer s Consumer
Background image of page 3

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

View Full DocumentRight Arrow Icon
M. Kargahi (School of ECE) Critical Sections s Structure of a Typical Process s Requirements for Solving critical-section problem: s Mutual exclusion s Progress s Bounded waiting
Background image of page 4
M. Kargahi (School of ECE) Two-Process Solutions s Algorithm 1 s Shared: int turn; P i : while (TRUE) { while (turn!=i); critical-section turn = 1-i; remainder-section } Mutual exclusion yes Progress no Bounded waiting yes
Background image of page 5

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

View Full DocumentRight Arrow Icon
M. Kargahi (School of ECE) Two-Process Solutions s Algorithm 2 s Shared: boolean flag[2]; P i : flag[i] = FALSE; do { flag[i] = TRUE; while (flag[j]); critical-section flag[i] = FALSE; remainder-section } while (TRUE); Mutual exclusion yes Progress no Bounded waiting yes
Background image of page 6
M. Kargahi (School of ECE) Peterson’s Solution
Background image of page 7

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

View Full DocumentRight Arrow Icon
M. Kargahi (School of ECE) Eisenberg & McGuire Solution
Background image of page 8
Eisenberg & McGuire Solution
Background image of page 9

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

View Full DocumentRight Arrow Icon
M. Kargahi (School of ECE) Synchronization Hardware s Atomic instructions: TestAndSet
Background image of page 10
M. Kargahi (School of ECE) Synchronization Hardware s Atomic instructions: Swap
Background image of page 11

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

View Full DocumentRight Arrow Icon
M. Kargahi (School of ECE) Synchronization Hardware s Spin lock s Methods that use busy waiting s n-process solution with bounded-waiting
Background image of page 12
M. Kargahi (School of ECE) Synchronization Hardware
Background image of page 13

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

View Full DocumentRight Arrow Icon
M. Kargahi (School of ECE) Semaphores s A semaphore S is an integer variable s Two atomic operations
Background image of page 14
M. Kargahi (School of ECE) Semaphore Usage s Critical-section s Process synchronization s Problems : Spin-lock & bounded-waiting
Background image of page 15

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

View Full DocumentRight Arrow Icon
M. Kargahi (School of ECE) A Better Definition
Background image of page 16
M. Kargahi (School of ECE)
Background image of page 17

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

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

This note was uploaded on 11/21/2010 for the course COMPUTER S 001 taught by Professor Kargahi during the Spring '10 term at Amirkabir University of Technology.

Page1 / 43

6.Process_Synchronization - Process Synchronization Mehdi...

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

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