Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Excelsior’s Washington, DC, center is located on M Street NW. The block is bound

ID: 3752108 • Letter: E

Question

Excelsior’s Washington, DC, center is located on M Street NW. The block is bounded to the south by L Street NW, to the west by 21st Street NW, and to the east by 20th Street NW. All streets are one-way, creating a counter-clockwise pattern surrounding the block. Traffic in DC is notoriously awful and cars typically block the box, that is, they enter the intersection when the traffic on the other side is not clear and end up blocking traffic on the perpendicular street (shown in diagram below).

a.  Explain that the four necessary conditions for deadlock are present in this scenario.
b.  What rule could the city implement that would avoid this situation in the future? Explain.


2.  Show that your student scheduling program from last week is deadlock-free.
3.  Add a rule to the dining philosopher’s problem that would ensure that it is deadlock-free.
4.  Can an OS detect whether a process is starving? If yes, explain how. If not, explain why not.
5.  Is deadlock possible in a system involving only one process? Explain why or why not.

2030 M Street Building Subway CVS Pharmacy Vidalia 2000 MO NW Gorman Jewelers ri US Commodity Futures Trading Commission ion Nosegay Flowers Nusta Sp ABC Imaging- Washington National Restaurant Association AdvantE Business centers Panera BreadPeace Corps Crepeaway Sprint Store Black Roos Barmy Wine

Explanation / Answer

1.
a. Mutual Exclusion
"The resources are blocked from the processes which are unshareable". There is a mutual exclusion in this scenario. The roads are blocked by cars and couldn't able to use it in anyways by any of the cars.

b. Hold and wait
It is holding some resource and waiting for some other resource. It is also applicable in this scenario. It has occupied the road and waiting to move it to another road which was already occupied.

c. no pre-emption
The resource allotted by process is unreleased. This is also applicable.

d. Circular wait
A set of process waiting for resources occupied by each other causing the circular condition. There is a circular condition in this case where car1 from road1 is waiting for car2 to move from road2 and so on.

b. What rule could the city implement that would avoid this situation in the future? Explain.
-> There should be proper scheduling and release of resources. Example: Traffic Signal
-> Prevention of blocking from the roads
-> Effective utilization of resources (Roads) by cars.

2. Please feel free to comment for answer of this question. I am not sure about what is student scheduling program given to you.

3. Implementing priority queue for threads and including process synchronization and interprocess communication through semaphores and mutex.

4. OS cannot detect starving of a process in prior. It requires future knowledge statistics. We cannot keep track of all the processes and analyze it constantly to check whether it is starving or not. There are thousands of processes running in the OS and starving can be avoided by using the correct scheduling algorithm and using the aging technique.

5.
Deadlock is not possible for a system involving only one process. If there is only one process running in the system, even though it occupies resource for an indefinite period of time, there is no issue. There is no circular wait, there is no preemption, there is no mutual exclusion or hold and wait.