subject

Simulate the traffic at the intersection of two one-way streets using semaphores. The traffic must obey the following rules: • Only one car can be crossing at any given time.
• When a car reaches the intersection and no other cars are approaching from the other direction, then the car must be allowed to proceed immediately.
• Cars arriving from both directions simultaneously must take turns in crossing.
The solution should obey the following principles:
• A car approaching from one direction is modeled by incrementing a corresponding counter (Ex: ns for north-south, ew for east-west).
• A busy flag indicates whether the intersection is free or whether a car is currently crossing.
• When busy is true, a car blocks on a semaphore corresponding to the car's direction.
• A blocked car is unblocked when the currently crossing car leaves the intersection.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:40
Design a pos circuit that displays the letters a through j on a seven-segment indicator. the circuit has four inputs w, x, y, and z which represent the last 4 bits of the uppercase ascii code for the letter to be displayed. thus, if wxyz = 0001 then "a" will be displayed. (any answer with 22 or fewer gates and inverters, not counting any for the inputs, is acceptable)
Answers: 2
question
Computers and Technology, 22.06.2019 14:20
Consider a byte-addressable computer with 16mb of main memory, a cache capable of storing a total of 64kb of data and block size of 32 bytes. (a) how many bits in the memory address? (b) how many blocks are in the cache? (c) specify the format of the memory address, including names and sizes, when the cache is: 1. direct-mapped 2. 4-way set associative 3. fully associative
Answers: 2
question
Computers and Technology, 23.06.2019 07:30
To check spelling errors in a document, the word application uses the to determine appropriate spelling. internet built-in dictionary user-defined words other text in the document
Answers: 2
question
Computers and Technology, 23.06.2019 15:00
To check whether your writing is clear , you can
Answers: 2
You know the right answer?
Simulate the traffic at the intersection of two one-way streets using semaphores. The traffic must o...
Questions
Questions on the website: 13722363