Presentation JP9 - Cooperating sequential processes

Presentation JP9 - Cooperating sequential processes -...

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

View Full Document Right Arrow Icon
Click to edit Master subtitle style 8/1/11 Cooperating sequential processes Felipe Bernal Isabel Virag Marcus Vinson Kevin Capers Manuel Arredondo By E. Dijkstra
Background image of page 1

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

View Full DocumentRight Arrow Icon
Click to edit Master subtitle style 8/1/11 An Example of a Priority Rule Felipe Bernal
Background image of page 2
8/1/11 An example of priority rule Previous Section: Use of general semaphore to couple a producer and a consumer via a bounded buffer Applicable only when the ‘portion’ is at the same time a convenient unit of information. This section considers producers that
Background image of page 3

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

View Full DocumentRight Arrow Icon
8/1/11 An example of priority rule The size of the portions is given in information units The capacity of the buffer is also given in information units The size of the portion offered
Background image of page 4
8/1/11 An example of priority rule Bound Buffer: Producer may have to wait before it can offer a portion (Variable sized portions can also imply that there is free space in the buffer but insufficient for the portion concerned) Requirement: The producer wishing to offer the larger portion gets priority over the producer
Background image of page 5

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

View Full DocumentRight Arrow Icon
8/1/11 An example of priority rule -When a producer has to wait, because the buffer cannot accommodate its portion, no other producers can therefore add their portions until further notice Example: Producer (1) Consumer (5) Producer (3) Buffer
Background image of page 6
8/1/11 Status Variables Desire Buffman Number of buffered units needed for the portion it could not add to the buffer Takes care of the mutual exclusion of buffer manipulations Semaphore that signals the presence of a next portion to the
Background image of page 7

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

View Full DocumentRight Arrow Icon
8/1/11 Status Variables Number of free buffer units Semaphore to signal back to producers free coming buffer space Integer value which states when no further additions to the buffer can be made until further notice.
Background image of page 8
8/1/11 Code Summary: Producer Add a new portion to the buffer directly or indirectly: If ( buffer blocking = 0 and number of free buffer units ≥ portion size ) decrease "number of free buffer units" AND add the portion to the buffer.
Background image of page 9

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

View Full DocumentRight Arrow Icon
8/1/11 Code Summary: Consumer Takes a portion and increases the number of free buffer units Test: if ( buffer blocking > 0) (false if no producer is waiting for free space just created) -looks for the maximum value of
Background image of page 10
Click to edit Master subtitle style 8/1/11 An Example of Conversations Isabel Virag
Background image of page 11

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

View Full DocumentRight Arrow Icon
8/1/11 An Example of Conversations -More complex example: One of the cooperating processes is now a human being (as opposed to a machine) -operator is connected via a "semi-duplex channel"
Background image of page 12
Requirements for Total Construction Features - N identical processes - Each process can ask a single question, called "Q1“ to which the operator may give one of two possible answers, called"A1" and "A2". - All N processes use the same communication channel.
Background image of page 13

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

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

Page1 / 62

Presentation JP9 - Cooperating sequential processes -...

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

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