Deadlock

Discussion in 'Homework Help' started by zulfi100, Apr 14, 2013.

  1. zulfi100

    Thread Starter Member

    Jun 7, 2012
    320
    0
    Hi,
    Kindly guide me with the following question

    Code ( (Unknown Language)):
    1.  
    2. Consider the three processes below, (proc1 through proc3,) each of which competes for six shared resources, (A through F):
    3. proc1()             proc2()             proc3()
    4. {               {                {
    5. while (1)           while (1)            while (1)
    6. {               {               {
    7. lock(&D);           lock(&C);            lock(&A);
    8. lock(&E);           lock(&F);            lock(&B);
    9. lock(&B);           lock(&D);            lock(&C);
    10. // Use D, E,        // Use C, F,        // Use A, B,
    11. // and B            // and D            // and C
    12. unlock(&D);         unlock(&C);          unlock(&A);
    13. unlock(&E);         unlock(&F);          unlock(&B);
    14. unlock(&B);         unlock(&D);          unlock(&C);
    15. }               }               }
    16.      }               }               }
    17. Could the three processes enter into deadlock?
    18.  
    Somebody plz guide me.

    Zulfi.
     
    Last edited by a moderator: Apr 14, 2013
  2. WBahn

    Moderator

    Mar 31, 2012
    17,716
    4,788
    I don't understand your notation.
     
  3. zulfi100

    Thread Starter Member

    Jun 7, 2012
    320
    0
    Hi,
    Thanks for your response. Plz tell me which notation? I dont know much but i would try my best.

    Zulfi.
     
Loading...