os4-1_cop.ppt - Operating Systems Introduction to Cooperating Processes A Frank P Weisberg Cooperating Processes \u2022 \u2022 \u2022 \u2022 \u2022 2 Introduction to

os4-1_cop.ppt - Operating Systems Introduction to...

This preview shows page 1 - 9 out of 29 pages.

A. Frank - P. Weisberg Operating Systems Introduction to Cooperating Processes
Image of page 1
2 A. Frank - P. Weisberg Cooperating Processes Introduction to Cooperating Processes Producer/Consumer Problem The Critical-Section Problem Synchronization Hardware Semaphores
Image of page 2
3 A. Frank - P. Weisberg Introduction to Cooperating Processes Processes within a system may be independent or cooperating. Independent process cannot affect or be affected by the execution of another process. Cooperating process can affect or be affected by other processes, including sharing data. Reasons for cooperating processes: Information sharing Computation speed-up Modularity Convenience
Image of page 3
4 Cooperation Models
Image of page 4
5 A. Frank - P. Weisberg Cooperation among Processes by Sharing Processes use and update shared data such as shared variables, memory, files, and databases. Writing must be mutually exclusive to prevent a race condition leading to inconsistent data views. Critical sections are used to provide this data integrity. A process requiring the critical section must not be delayed indefinitely; no deadlock or starvation.
Image of page 5
6 A. Frank - P. Weisberg Cooperation among Processes by Communication Communication by messages provides a way to synchronize, or coordinate, the various activities. Possible to have deadlock – each process waiting for a message from the other process. Possible to have starvation – two processes sending a message to each other while another process waits for a message.
Image of page 6
7 A. Frank - P. Weisberg Producer/Consumer (P/C) Problem (1 ( Paradigm for cooperating processes – Producer process produces information that is consumed by a Consumer process. Example 1: a print program produces characters that are consumed by a printer. Example 2: an assembler produces object modules that are consumed by a loader.
Image of page 7
8 A. Frank - P. Weisberg Producer/Consumer (P/C) Problem (2 ( We need a buffer to hold items that are produced and later consumed: unbounded-buffer places no practical limit on the size of the buffer.
Image of page 8
Image of page 9

You've reached the end of your free preview.

Want to read all 29 pages?

  • Summer '18
  • Aileen
  • Race condition, Concurrent computing, P. Weisberg, A. Frank

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture