《操作系统》的实验代码。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

257 lines
7.2 KiB

  1. start here
  2. _____________________________________________
  3. MAX Allocated Need
  4. [18, 16, 0, 0] [17, 8, 0, 0] [1, 8, 0, 0]
  5. [4, 5, 0, 0] [0, 0, 0, 0] [4, 5, 0, 0]
  6. [2, 2, 0, 1] [0, 0, 0, 0] [2, 2, 0, 1]
  7. _____________________________________________
  8. Resources:
  9. Total: [28, 28, 1, 2] Available: [11, 20, 1, 2]
  10. Executing...
  11. Request:
  12. [1, 8, 0, 0]
  13. Dispatching Done...
  14. _____________________________________________
  15. MAX Allocated Need
  16. [18, 16, 0, 0] [18, 16, 0, 0] [0, 0, 0, 0]
  17. [4, 5, 0, 0] [0, 0, 0, 0] [4, 5, 0, 0]
  18. [2, 2, 0, 1] [0, 0, 0, 0] [2, 2, 0, 1]
  19. _____________________________________________
  20. Resources:
  21. Total: [28, 28, 1, 2] Available: [10, 12, 1, 2]
  22. -----Releasing Process------
  23. _____________________________________________
  24. MAX Allocated Need
  25. [18, 16, 0, 0] [0, 0, 0, 0] [0, 0, 0, 0]
  26. [4, 5, 0, 0] [0, 0, 0, 0] [4, 5, 0, 0]
  27. [2, 2, 0, 1] [0, 0, 0, 0] [2, 2, 0, 1]
  28. _____________________________________________
  29. Resources:
  30. Total: [28, 28, 1, 2] Available: [28, 28, 1, 2]
  31. Executing...
  32. Request:
  33. [4, 5, 0, 0]
  34. Dispatching Done...
  35. _____________________________________________
  36. MAX Allocated Need
  37. [18, 16, 0, 0] [0, 0, 0, 0] [0, 0, 0, 0]
  38. [4, 5, 0, 0] [4, 5, 0, 0] [0, 0, 0, 0]
  39. [2, 2, 0, 1] [0, 0, 0, 0] [2, 2, 0, 1]
  40. _____________________________________________
  41. Resources:
  42. Total: [28, 28, 1, 2] Available: [24, 23, 1, 2]
  43. -----Releasing Process------
  44. _____________________________________________
  45. MAX Allocated Need
  46. [18, 16, 0, 0] [0, 0, 0, 0] [0, 0, 0, 0]
  47. [4, 5, 0, 0] [0, 0, 0, 0] [0, 0, 0, 0]
  48. [2, 2, 0, 1] [0, 0, 0, 0] [2, 2, 0, 1]
  49. _____________________________________________
  50. Resources:
  51. Total: [28, 28, 1, 2] Available: [28, 28, 1, 2]
  52. Executing...
  53. Request:
  54. [2, 2, 0, 1]
  55. Dispatching Done...
  56. _____________________________________________
  57. MAX Allocated Need
  58. [18, 16, 0, 0] [0, 0, 0, 0] [0, 0, 0, 0]
  59. [4, 5, 0, 0] [0, 0, 0, 0] [0, 0, 0, 0]
  60. [2, 2, 0, 1] [2, 2, 0, 1] [0, 0, 0, 0]
  61. _____________________________________________
  62. Resources:
  63. Total: [28, 28, 1, 2] Available: [26, 26, 1, 1]
  64. -----Releasing Process------
  65. _____________________________________________
  66. MAX Allocated Need
  67. [18, 16, 0, 0] [0, 0, 0, 0] [0, 0, 0, 0]
  68. [4, 5, 0, 0] [0, 0, 0, 0] [0, 0, 0, 0]
  69. [2, 2, 0, 1] [0, 0, 0, 0] [0, 0, 0, 0]
  70. _____________________________________________
  71. Resources:
  72. Total: [28, 28, 1, 2] Available: [28, 28, 1, 2]
  73. SUCCESS proc lists [0, 1, 2]
  74. _____________________________________________
  75. MAX Allocated Need
  76. [3, 3, 2, 2] [1, 2, 2, 1] [2, 1, 0, 1]
  77. [1, 2, 3, 4] [1, 0, 3, 3] [0, 2, 0, 1]
  78. [1, 3, 5, 0] [1, 2, 1, 0] [0, 1, 4, 0]
  79. _____________________________________________
  80. Resources:
  81. Total: [6, 5, 7, 6] Available: [3, 1, 1, 2]
  82. Executing...
  83. Request:
  84. [2, 1, 0, 1]
  85. Dispatching Done...
  86. _____________________________________________
  87. MAX Allocated Need
  88. [3, 3, 2, 2] [3, 3, 2, 2] [0, 0, 0, 0]
  89. [1, 2, 3, 4] [1, 0, 3, 3] [0, 2, 0, 1]
  90. [1, 3, 5, 0] [1, 2, 1, 0] [0, 1, 4, 0]
  91. _____________________________________________
  92. Resources:
  93. Total: [6, 5, 7, 6] Available: [1, 0, 1, 1]
  94. -----Releasing Process------
  95. _____________________________________________
  96. MAX Allocated Need
  97. [3, 3, 2, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  98. [1, 2, 3, 4] [1, 0, 3, 3] [0, 2, 0, 1]
  99. [1, 3, 5, 0] [1, 2, 1, 0] [0, 1, 4, 0]
  100. _____________________________________________
  101. Resources:
  102. Total: [6, 5, 7, 6] Available: [4, 3, 3, 3]
  103. Executing...
  104. Request:
  105. [0, 2, 0, 1]
  106. Dispatching Done...
  107. _____________________________________________
  108. MAX Allocated Need
  109. [3, 3, 2, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  110. [1, 2, 3, 4] [1, 2, 3, 4] [0, 0, 0, 0]
  111. [1, 3, 5, 0] [1, 2, 1, 0] [0, 1, 4, 0]
  112. _____________________________________________
  113. Resources:
  114. Total: [6, 5, 7, 6] Available: [4, 1, 3, 2]
  115. -----Releasing Process------
  116. _____________________________________________
  117. MAX Allocated Need
  118. [3, 3, 2, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  119. [1, 2, 3, 4] [0, 0, 0, 0] [0, 0, 0, 0]
  120. [1, 3, 5, 0] [1, 2, 1, 0] [0, 1, 4, 0]
  121. _____________________________________________
  122. Resources:
  123. Total: [6, 5, 7, 6] Available: [5, 3, 6, 6]
  124. Executing...
  125. Request:
  126. [0, 1, 4, 0]
  127. Dispatching Done...
  128. _____________________________________________
  129. MAX Allocated Need
  130. [3, 3, 2, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  131. [1, 2, 3, 4] [0, 0, 0, 0] [0, 0, 0, 0]
  132. [1, 3, 5, 0] [1, 3, 5, 0] [0, 0, 0, 0]
  133. _____________________________________________
  134. Resources:
  135. Total: [6, 5, 7, 6] Available: [5, 2, 2, 6]
  136. -----Releasing Process------
  137. _____________________________________________
  138. MAX Allocated Need
  139. [3, 3, 2, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  140. [1, 2, 3, 4] [0, 0, 0, 0] [0, 0, 0, 0]
  141. [1, 3, 5, 0] [0, 0, 0, 0] [0, 0, 0, 0]
  142. _____________________________________________
  143. Resources:
  144. Total: [6, 5, 7, 6] Available: [6, 5, 7, 6]
  145. SUCCESS proc lists [0, 1, 2]
  146. _____________________________________________
  147. MAX Allocated Need
  148. [10, 8, 2, 5] [3, 0, 0, 3] [7, 8, 2, 2]
  149. [6, 1, 3, 1] [1, 1, 2, 0] [5, 0, 1, 1]
  150. [3, 1, 4, 2] [2, 1, 2, 1] [1, 0, 2, 1]
  151. [5, 4, 2, 1] [0, 0, 2, 0] [5, 4, 0, 1]
  152. _____________________________________________
  153. Resources:
  154. Total: [10, 10, 8, 5] Available: [4, 8, 2, 1]
  155. Executing...
  156. Request:
  157. [7, 8, 2, 2]
  158. HOLD: not enough Resource
  159. Executing...
  160. Request:
  161. [5, 0, 1, 1]
  162. HOLD: not enough Resource
  163. Executing...
  164. Request:
  165. [1, 0, 2, 1]
  166. Dispatching Done...
  167. _____________________________________________
  168. MAX Allocated Need
  169. [10, 8, 2, 5] [3, 0, 0, 3] [7, 8, 2, 2]
  170. [6, 1, 3, 1] [1, 1, 2, 0] [5, 0, 1, 1]
  171. [3, 1, 4, 2] [3, 1, 4, 2] [0, 0, 0, 0]
  172. [5, 4, 2, 1] [0, 0, 2, 0] [5, 4, 0, 1]
  173. _____________________________________________
  174. Resources:
  175. Total: [10, 10, 8, 5] Available: [3, 8, 0, 0]
  176. -----Releasing Process------
  177. _____________________________________________
  178. MAX Allocated Need
  179. [10, 8, 2, 5] [3, 0, 0, 3] [7, 8, 2, 2]
  180. [6, 1, 3, 1] [1, 1, 2, 0] [5, 0, 1, 1]
  181. [3, 1, 4, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  182. [5, 4, 2, 1] [0, 0, 2, 0] [5, 4, 0, 1]
  183. _____________________________________________
  184. Resources:
  185. Total: [10, 10, 8, 5] Available: [6, 9, 4, 2]
  186. Executing...
  187. Request:
  188. [7, 8, 2, 2]
  189. HOLD: not enough Resource
  190. Executing...
  191. Request:
  192. [5, 0, 1, 1]
  193. Dispatching Done...
  194. _____________________________________________
  195. MAX Allocated Need
  196. [10, 8, 2, 5] [3, 0, 0, 3] [7, 8, 2, 2]
  197. [6, 1, 3, 1] [6, 1, 3, 1] [0, 0, 0, 0]
  198. [3, 1, 4, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  199. [5, 4, 2, 1] [0, 0, 2, 0] [5, 4, 0, 1]
  200. _____________________________________________
  201. Resources:
  202. Total: [10, 10, 8, 5] Available: [1, 9, 3, 1]
  203. -----Releasing Process------
  204. _____________________________________________
  205. MAX Allocated Need
  206. [10, 8, 2, 5] [3, 0, 0, 3] [7, 8, 2, 2]
  207. [6, 1, 3, 1] [0, 0, 0, 0] [0, 0, 0, 0]
  208. [3, 1, 4, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  209. [5, 4, 2, 1] [0, 0, 2, 0] [5, 4, 0, 1]
  210. _____________________________________________
  211. Resources:
  212. Total: [10, 10, 8, 5] Available: [7, 10, 6, 2]
  213. Executing...
  214. Request:
  215. [7, 8, 2, 2]
  216. Dispatching Done...
  217. _____________________________________________
  218. MAX Allocated Need
  219. [10, 8, 2, 5] [10, 8, 2, 5] [0, 0, 0, 0]
  220. [6, 1, 3, 1] [0, 0, 0, 0] [0, 0, 0, 0]
  221. [3, 1, 4, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  222. [5, 4, 2, 1] [0, 0, 2, 0] [5, 4, 0, 1]
  223. _____________________________________________
  224. Resources:
  225. Total: [10, 10, 8, 5] Available: [0, 2, 4, 0]
  226. -----Releasing Process------
  227. _____________________________________________
  228. MAX Allocated Need
  229. [10, 8, 2, 5] [0, 0, 0, 0] [0, 0, 0, 0]
  230. [6, 1, 3, 1] [0, 0, 0, 0] [0, 0, 0, 0]
  231. [3, 1, 4, 2] [0, 0, 0, 0] [0, 0, 0, 0]
  232. [5, 4, 2, 1] [0, 0, 2, 0] [5, 4, 0, 1]
  233. _____________________________________________
  234. Resources:
  235. Total: [10, 10, 8, 5] Available: [10, 10, 6, 5]
  236. Failed