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

  Optimal page replacement strategy

What is minimum number of page faults for the optimal page replacement strategy? Please show how the page is placed and how page faults occur.

  Role of a database management system

Discuss the role of a database management system (DBMS) and what are its benefits and how does a relational database management system differ from a flat document?

  Single table manipulation and table join manipulation

Explain one drawbacks and benefits of Internet enabled technology use by firms to augment information flow both within and between company departments, partners, and consumers?

  A typist is entering text on a keyboard

A typist is entering text on a keyboard at the rate of 30 words per minute. If each word is 6 characters long on average, how many bits per second are being sent to main memory? A space is also a character. Assume that each word is followed by one sp..

  Creating pseudocode

Create pseudocode for the Citron Car rental policy, Standard transmission is available only for A, B, and C. Automatic transmission is available for all cars.

  A current implementation of a particular multicore

A current implementation of a particular multicore processor has a 64KB Level one cache for each core, 256KB Level two, and 6MB for level three.

  Question about network management systems

Discuss and provide examples of the Network Management Systems. In most industries it is very important to know all the issues.

  Describe benefits of providing synchronization tool

Slim reader-writer locks favor neither readers nor writers, nor are waiting threads ordered in FIFO queue. Describe benefits of providing such a synchronization tool.

  Find total memory bytes stored in the cache

Following, a byte addressable main memory of 2^16 bytes and block size of eight bytes, using direct mapped cache consisting of thirty-two lines.

  Internal application server for application systems

Classic Catalog Corporation runs a small but rapidly increasing catalog sales business. It outsourced its Web operations to a local ISP for many years but as Web have become a larger portion of its business,

  Question about virus defense

Discuss how can an individual machine get infected with the virus you are researching and how does it spread to other equipments?

  How many page faults are generated array-initialization loop

Illustrate how many page faults are generated by following array-initialization loops, using LRU replacement, and assuming page frame 1 has process in it, and the other two are initially empty?

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