{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ipc examples - Interprocess Communication 1 Ways of passing...

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

View Full Document Right Arrow Icon
1 Interprocess Communication 1. Ways of passing information 2. Guarded critical activities 3. Proper sequencing in case of dependencies 2 and 3 apply to threads as well.
Background image of page 1

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

View Full Document Right Arrow Icon
2 Race Conditions Two processes want to access shared memory at the same time. The final result depends on who runs precisely when.
Background image of page 2
3 Critical Regions (1) Part of the program where shared memory is accessed. Four conditions to provide mutual exclusion: 1. No two processes simultaneously in critical region 2. No assumptions made about speeds or numbers of CPUs 3. No process running outside its critical region may block another process 4. No process must wait forever to enter its critical region
Background image of page 3

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

View Full Document Right Arrow Icon
4 Critical Regions (2) Mutual exclusion using critical regions
Background image of page 4
5 Attempts for Mutual Exclusion Using Busy Waiting 1. Disabling all interrupts (only by kernel!) 2. Lock variables => fatal race condition 3. Strict alternation using spin locks - violates condition 3 4. Peterson’s solution 5. Test-and-set locks (TSL) Priority inversion problem
Background image of page 5

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

View Full Document Right Arrow Icon
6 Strict Alternation Proposed solution to critical region problem (a) Process 0. (b) Process 1.
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.

{[ snackBarMessage ]}