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

3. Consider a solution to thefollowing variant of the dining-philosophers proble

ID: 3617071 • Letter: 3

Question

3. Consider a solution to thefollowing variant of the dining-philosophers problem.There

are n2processes and 2n2copies of a resource. A process needs anexclusive access to

arbitrary 4 among the copies tobe able to use the resource. Processes are logically

arranged in a two dimensionaltorus: each has coordinate <i;j>, where 0 i; j n-1.

Two processes<i1;j1> and<i2;j2> are neighbors in thetorus if either i1= i2and

0 i n-1, all the processes<i; j> where 0 j n-1 operate as a table ofdining

philosophers. Similarly, for each xed0 j n - 1, all the processes<i; j>,where

0 i n-1 operate as a table of diningphilosophers. Each process belongs to two

tables, andcan obtain two copies of the resource from eachtable.

(a) Doesthis solution provide safety?

(b) If youbelieve this to be the case, then does it preventdeadlock?

(c) If youbelieve that both questions above are answered in the armative,then

does it provide lockoutfreedom?

Explanation / Answer

(a)

Yes it provides safety, by using logical as base of DiningPhilosophers problem. One Philosopher owned by each resource at atime.

(b)

If there are n2 processesand 2n2 copies of a resource.

If n=1 then 2 processes

     n=2 then 4 processes

1       (0,0)

2       (0,1)

3       (1,0)

4       (1,1)

A process needs an exclusive access to arbitrary 4 amongthe copies to be able to use the resource.

Your 4 processor tablesare       

States

Hypothetical

i=0  

12  

1 Possesses both resources

i=1  

34  

4 Possesses both resources

j=0  

13  

3 Possesses both resources

j=1  

24  

2 Possesses both resources

In this hypothetical situation, you have adeadlock.

States

Hypothetical

i=0  

12  

1 Possesses both resources

i=1  

34  

4 Possesses both resources

j=0  

13  

3 Possesses both resources

j=1  

24  

2 Possesses both resources

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote