Create algorithm which prevents deadlock using one semaphore

Assignment Help Operating System
Reference no: EM1369676

1. A single-lane pedestrian bridge connects the two villages of Village1 and Village2. People in the two villages use this bridge to go to other village. The bridge can become deadlocked if people both from Village1 and Village2 get on the bridge at the same time Once a person get on the bridge, he/she is unable to back up.

a. Using exactly one semaphore, design an algorithm that prevents deadlock. Do not be concerned about starvation and inefficiency.

b. Provide a solution using Monitor that is starvation-free.

c. What would be the value of semaphore before entering into Critical Section and after leaving it?

Reference no: EM1369676

Questions Cloud

Recruitment of employees and explain : What factors would you consider most important in recruitment of employees and explain
Mpc change : Assume that economy starts at equilibrium and the mpc= 0.75. Determine what would be the effect of a $300 increase in government spending once all the rounds of the multiplier process are complete?
Plan for implementation of net product : Describe the market at which the new product/service will be implemented.
Explain the executive and the independent administrative : Explain the "executive" and the "independent" administrative agencies. The primary distinction between the two types of agencies is that the heads of executive administrative agencies are appointed by the president and serve
Create algorithm which prevents deadlock using one semaphore : Using exactly one semaphore, create an algorithm which prevents deadlock. Do not be concerned about starvation and inefficiency.
Survey or questionnaire for employees and managers : Survey Questionnaire - Survey or questionnaire for employees and managers at the USPS office
Pricing by monopolistic competition : Assume there are only two automobile companies, Ford and Chevrolet. Ford believes that Chevrolet will match any value it sets, but Chevrolet too is interested in maximizing profit.
Mary kay cosmetics case study : This is a complete business case study on Mary Kay Cosmetics along with recommendations for improving employee moral and bottom line numbers.
Write pseudocode for procedure construct-optimal-bst : Write pseudocode for procedure Construct-Optimal-BST (root) which, table root, outputs structure of the optimal bimary search tree.

Reviews

Write a Review

Operating System Questions & Answers

  Define the term context switch

Define the term context switch. Explain how context switching takes place. (use a diagram, with two processes)

  Page table entries are needed for two-level paging

Assume that word 0 is part of a hole and that the highest word in memory contains valid tries are needed in the page table if traditional(one-level) paging is used? how many page table entries are needed for two-level paging, with 10 bits in ea..

  Specify the order in which processes execute

Specify the order in which processes execute and determine the mean process turnaround time for each of the scheduling algorithms.

  Page frames for public use and seven-page program

Given that main memory is consisted of three page frames for public use and that seven-page program (with pages a, b, c, d, e, f, g) requests pages in the following order: a, b, a, c, d, a, e, f, g, c, b, g.

  Give three technical merits of unix

Give three technical merits of UNIX b) Differentiate between "clustered systems" and "real-time systems". c) Describe the purpose of using "trust relationship"

  Draw curves for throughput-delay and power

Assume two hosts A and B are connected via router R. A-R link has infinite bandwidth; A-R link has infinite bandwidth; draw curves for throughput, delay, and power, each as function of load.

  Power management settings in bios

Every day at 2PM a client's computer at work reboots itself. You have made sure the power management settings in the BIOS and in the Windows Control Panel are not responsible.

  Deadlock avoidance

i. Deadlock avoidance ii. Deadlock prevention and  iii. Deadlock detection

  Explain trade-off between memory use and cpu overhead

Remembering that there's a trade-off between memory use. Then give an example where doing so will cause throughput to suffer.

  Implement the parser in two iterations

Implement the parser in a separate file. Implement the main parser function in a separate file main.c

  Explain how to implement barriers using semaphores

Show how to implement barriers using semaphores. Your solution should avoid busy-waiting. Be explicit about any initializations that you need to assume.

  Explain the client-server architecture

What are the three different categories of command, support your answer by giving three examples. Give three good reasons, with valid explanation, to justify why partitioning hard disk provides a variety of advantages. Explain the client/server..

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