Consider a version of the bounded buffer problem

Assignment Help Operating System
Reference no: EM13165832

Consider a version of the bounded buffer problem in which there is two producer processes (P1and P2) and one consumer processes (P3) all sharing the same buffer. Assume that the size of the buffer is n=4, and that we start with a completely empty buffer. The structure of P1, P2, and P3 as well as the semaphores and buffer is shown below:

 

/* structure of P1 & P2*/do {......produce an item in nextp......wait(empty)wait(mutex)buffer[in]= nextpin = (in + 1) % nsignal(mutex)signal(full)}while(1)



/* structure of P3 */do {wait(full)wait(mutex)nextp = buffer[out]out = (out + 1) % nsignal(mutex)signal(empty)...........consume item in nextp........}while(1)

[   ] item0            [ 0 ] in
[   ] item1      [ 0 ] out
[   ] item0            [ 4 ] empty
[   ] item3            [ 0 ] full
                [ 1 ] mutex   




Assume a priority scheduler and that all processes start in the ready queue at the same time in the order from head to tail, P1, P2, and P3 (P1 at the head of the queue). The scheduling priorities are P1:1, P2:1, and P3:5. Assume that thesemaphore queues use a priority scheme in which P2 (highest priority) > P1> P3 (lowest priority). Draw the contents of the indices "in" and "out", as well as the state of the semaphores and the contents of the buffer after 2 items have been consumed. In the case of the buffers, simply notate each item with the name of the process that accessed it last.

Draw the contents of the indices "in" and "out", as well as the state of the semaphores and the contents of the buffer after 2 items have been consumed. In the case of the buffers, simply notate each item with the name of the process that accessed it last.


[   ] item0            [ ] in
[   ] item1      [ ] out
[   ] item0            [ ] empty
[   ] item3            [ ] full
                [ ] mutex

 

Reference no: EM13165832

Questions Cloud

Make the circles have a thickness of 5 pixels, : Make the circles have a thickness of 5 pixels, except for the circle that didn't open at Sochi; make that one a solid disk.
Script that creates and calls a function : Write a script that creates and calls a function named fnItemTotal that calculates the total amount of an item in the OrderItems table (discount price multiplied by quantity)
Accepts filename to sort and run : Accepts filename to sort and run size as command line arguments. Calls the sort routine. Writes the sorted result to a file named sorted.txt.
Write in c++ another overloaded operator : Write in C++ another overloaded operator to go in the program that has Treasury. Overload the forward slash /  so that in the main program, you can declare sale to be of type Treasury, and commission to be of type Treasury, and commispctage to be of ..
Consider a version of the bounded buffer problem : Consider a version of the bounded buffer problem in which there is two producer processes (P1and P2) and one consumer processes (P3) all sharing the same buffer. Assume that the size of the buffer is n=4, and that we start with a completely empty buf..
What is the infinite union of all context-sensitive language : What is the infinite union of all context-sensitive languages? Decidable languages? What is the infinite intersection of all context-sensitive languages? Decidable languages?
Match the os mechanisms on the left to the hardware support : Match the OS mechanisms on the left to the hardware support specific for each mechanism on the right.
Decision tables and dependency diagrams : Decision Tables and Dependency Diagrams
Stored procedure named spinsertcategory : Write a script that creates and calls a stored procedure named spInsertCategory. First, code a statement that creates a procedure that adds a new row to the Categories table. To do that

Reviews

Write a Review

Operating System Questions & Answers

  Solving networking question

Your corporation has a network that contains many NetWare 4.11 servers and uses IPX as the routing protocol. Each of network sections has at least one NetWare server on it.

  Developing a web portal for modeling agency

The designer starts with a high level description of functions that are to be implemented and builds lower level explanations of how each module will be organized and related to other modules.

  Write a multi-threaded program

Write a multi-threaded program to solve producer and consumer problem

  Steps add to the check list

According to your personal experience, what steps would you add to the check list and determine what steps would you leave out?

  Discuss drawbacks and benefits of specialization

IT administrators in small corporations must often execute various functions at same time like network administrator, database administrator, user consultant and others.

  Distinguish licensing requirements-linux-microsoft windows

Distinguish the licensing requirements for Linux versus Microsoft Windows with particular attention paid to GNU-General Public License.

  Identify properties of communication channel

Write the send and receive primitives for stated processes. Identify at least three properties of communication channel or link in this scheme

  Perspective of provisions of ebusiness services

Discuss and explain the different roles you might think be fulfilled through Web Services and Web Portals. What do you see as main distinctions between two from the perspective of provisions of eBusiness services?

  Designing phase of the project management life cycle

Discuss how does the design phase of the project management life cycle differ in content and importance from the other phases?

  Disk requests arrive at the disk driver

Disk requests arrive at the disk driver for cylinders, 45, 97,21,43,11,69,81,8,55,14,78,74, and 7. A seek takes 5 milliseconds per cylinder moved. Assume that the arm starts initially at cylinder 50 and was moving downward.

  Drawbacks and benefits of a peer to peer network

Describe to Champions the drawbacks and benefits of a peer-to-peer network. What can be shared between hosts?

  Identify issues of poor technology management

Assume you are the task manager for a large consumer service corporation consisting of 1,000 workers. You are responsible for 25 direct reports in your department.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd