正在加载图片...
2.Consider three processes,pl,p2 and p3,executing asynchronously the following sequences of code: p1 p2 p3 x.acquire() y.acquire() z.acquire() -z.acquire() y.acquire() >x.acquire() x.release() z.release() z.release() x.release() The arrow in each line indicates which instruction the corresponding process is currently executing.All semaphores were initially set to 1. (a)Draw a resource graph describing the above situation where each semaphore is interpreted as a resource,and acquire()and release()operations represent the requests and releases of the resources. (b)Is there a deadlock state? (c)If you could increase the number of units of any of the three resources,which increase(if any) would resolve the deadlock? A卷总8_页第_3_页A 卷 总 8 页 第 3 页 2. Consider three processes, p1, p2 and p3, executing asynchronously the following sequences of code: p1 p2 p3 . . . x.acquire() . . . z.acquire() . . . x.release() . . . z.release() . . . y.acquire() . . . y.acquire() . . . . . . z.acquire() . . . x.acquire() . . . z.release() . . . x.release() The arrow in each line indicates which instruction the corresponding process is currently executing. All semaphores were initially set to 1. (a) Draw a resource graph describing the above situation where each semaphore is interpreted as a resource, and acquire() and release() operations represent the requests and releases of the resources. (b) Is there a deadlock state? (c) If you could increase the number of units of any of the three resources, which increase(if any) would resolve the deadlock?
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有