Page 114 - DCAP403_Operating System
P. 114

Unit 6: Process Synchronization




          age=5427, philosopher 3 is hungry                                                     Notes
          age=5431, philosopher 3 has taken forks
          age=5432, philosopher 3 eating for 857 ms
          age=5569, philosopher 4 is hungry
          age=6298, philosopher 3 has returned forks
          age=6301, philosopher 3 thinking for 1309 ms
          age=6302, philosopher 5 is hungry
          age=6304, philosopher 4 has taken forks
          age=6305, philosopher 4 eating for 498 ms
          age=6428, philosopher 1 has returned forks
          age=6430, philosopher 1 thinking for 1517 ms
          age=6432, philosopher 2 has taken forks
          age=6433, philosopher 2 eating for 133 ms
          age=6567, philosopher 2 has returned forks
          age=6570, philosopher 2 thinking for 3243 ms
          age=6808, philosopher 4 has returned forks
          age=6810, philosopher 4 thinking for 2696 ms
          age=6812, philosopher 5 has taken forks
          age=6813, philosopher 5 eating for 1838 ms
          age=7617, philosopher 3 is hungry
          age=7621, philosopher 3 has taken forks
          age=7622, philosopher 3 eating for 1251 ms
          age=7957, philosopher 1 is hungry
          age=8658, philosopher 5 has returned forks
          age=8661, philosopher 5 thinking for 4755 ms
          age=8662, philosopher 1 has taken forks
          age=8664, philosopher 1 eating for 1426 ms
          age=8877, philosopher 3 has returned forks
          age=8880, philosopher 3 thinking for 2922 ms
          age=9507, philosopher 4 is hungry
          age=9511, philosopher 4 has taken forks
          age=9512, philosopher 4 eating for 391 ms
          age=9817, philosopher 2 is hungry
          age=9908, philosopher 4 has returned forks
          age=9911, philosopher 4 thinking for 3718 ms
          age=10098, philosopher 1 has returned forks
          age=10100, philosopher 1 thinking for 2541 ms
          must stop now
          age=10109, philosopher 2 has taken forks
          age=10110, philosopher 2 eating for 206 ms
          % ./dphi 5 10 1 10 10 1 1 10 10 1 10 1
          5 dining philosophers running 10 seconds
          dining server for 5 philosophers is alive




                                           LOVELY PROFESSIONAL UNIVERSITY                                   107
   109   110   111   112   113   114   115   116   117   118   119