Deign a synchronization solution using only locks

Assignment Help Computer Engineering
Reference no: EM132085624

There is a one-lane east-west bridge in Hawaii such that when a car is on the bridge going eastbound, no westbound cars are allowed until the eastbound car has left the bridge.

Similarly when a westbound car is on the bridge, no eastbound cars are allowed until the westbound car has left the bridge.

To make matters more complicated, if an eastbound car arrives and sees another eastbound car already on the bridge, then that eastbound car will also proceed onto the bridge.

This is true even if there is a westbound car already waiting to enter the bridge.

Similarly, a westbound car can tailgate behind another westbound car already on the bridge even if an eastbound car was waiting.

Deign a synchronization solution using only locks, semaphores and integer variables that achieves the following:

allows all cars bound in a certain direction to continue crossing as long as there is at least one car still on the bridge that is bound in that direction, then toggles to allow all cars in the opposite direction to proceed in a similar manner. The solution need not be starvation-free.

Reference no: EM132085624

Questions Cloud

What factors should a computer designer take into account : What is one way to measure Cache performance and one way to improve Cache performance?
Write a class called darts : One way to estimate the value of p is to simulate a darts game. The darts player throws at a circular board with a radius of 1 foot.
The interarrival time has an exponential distribution : Cars arrive at Joe’s Service Station for an oil change every 15 minutes, and the interarrival time has an exponential distribution.
How will your team manage any conflict which may arise : How will you as a team communicate if a team member is not contributing and collaborating effectively? How will your team manage any conflict which may arise?
Deign a synchronization solution using only locks : Deign a synchronization solution using only locks, semaphores and integer variables that achieve.
Develop a crud matrix develop a crud matrix : Identify Create, Update, and Delete Privileges For each piece of information, first identify who has create, update, and delete privileges.
Calculate the net present value and profitability index : BAK Corp. is considering purchasing one of two new diagnostic machines. Calculate the net present value and profitability index of each machine
Expalin variables in java must have a declared type : For each one of the following statements about Java, indicate whether or not it is also true for Smalltalk.
Discuss about the database transaction management : The simulation times, number of data blocks, and longest read or write time period are set at the beginning of the simulation.

Reviews

Write a Review

Computer Engineering Questions & Answers

  What is mflops rating of the system

What is MFLOPS rating of the system

  Write a program that reads three strings from the user

Write a program that reads three strings from the user, then determines and prints how many times the letters ‘e' appears in the first string, ‘t' appears.

  Prepare a program which manages a registry of compact discs

make a program that manages a registry of compact discs cds. the register may e.g. based on a doubly linked list

  How are software components organized to perform functions

An OS acts as both client and server. How are software components organized to perform both functions at the same time?

  The default text-based command-driven communication

If you need to create clean Web pages, which of the following is the best choice. If you need to create a text document with some graphics and format it for printing, which of the following is the best choice. Computer directories or folders are use..

  Write some cpp code that will read a line of text

Write some C++ code that will read a line of text and echo the line with all uppercase letters deleted. Rewrite the definition of the new Line function.

  Why do you think the given method is not used any more

Since a tape can easily be simulated on disk (as a file), why do you think this method is not used any more?

  What happens if you join on yourself

What happens if you join on yourself? A Mach thread creates two new threads as its children, A and B. Thread A does a detach call; B does not.

  What attributes would you require to explain an entity

what attributes would you need to describe an entity called video for a video store? also what would you use as the

  Why do you think that many parents appear to prefer to use

1. reflect on the parenting style andor model of your own parents or guardians. based on what you observed and what you

  Distinguish between passive and active security attacks

Distinguish between passive and active security attacks. Name some passive attacks. List and define live scanty services discussed in this chapter.

  Computer graphics make a comparison between vector graphics

make a comparison between vector graphics and raster graphics display system and justify your

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