Semaphore Problem Suppose, there are three producers P1, P2, and P3 who want to produce and put items in the buffer. And, there are four consumers C1, C2, C3, and C4 who want to consume items from the buffer. No process takes more than 5 units of time to complete unless the process goes to the waiting queue(S->list) of semaphore. At a certain point of the execution, following are the values of the semaphores: mutex=1 , countEmpty=8, countFull=2 Find the

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
icon
Concept explainers
Question

Semaphore Problem

Suppose, there are three producers P1, P2, and P3 who want to produce and put items in the buffer. And, there are four consumers C1, C2, C3, and C4 who want to consume items from the buffer. No process takes more than 5 units of time to complete unless the process goes to the waiting queue(S->list) of semaphore.

At a certain point of the execution, following are the values of the semaphores:

mutex=1 , countEmpty=8, countFull=2

Find the output of the following sequence of commands.

At time 0 : C1 started

At time 0: C2 started

At time 10: C3 started

Value of countEmpty ?

Value of countFull ?

Processes in the waiting queue of the semaphore ?

[Write process names with Capital letter, For example: P7. If there are multiple process writes their names using comma, For example: P6,P7. If there is no process in the semaphore's list, write EMPTY in the box]

At time 15 : P1 started

At time 20 : P2 started

Value of countEmpty ?

Value of countFull ?

Processes in the waiting queue of the semaphore ?

At time 25 : C4 started

At time 30 : P3 started

Value of countEmpty ?

Value of countFull ?

Processes in the waiting queue of the semaphore ?

Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Heuristic System
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education