门|门CS 1997 |问题74

操作系统按如下方式处理对资源的请求。 进程(请求一些资源,使用它们一段时间,然后退出系统)在启动时被分配一个唯一的时间戳。时间戳随时间单调增加。让我们用TS(P)来表示进程P的时间戳。

null

当进程P请求资源时,操作系统会执行以下操作:

(i) If no other process is currently holding the resource, the OS awards the resource to P.
(ii) If some process Q with TS(Q)<TS(P) is holding the resource, the OS makes P wait for 
     the resources.
(iii) If some process Q with TS(Q)>TS(P) is holding the resource, the OS restarts Q 
      and awards the resources to P.
(Restarting means taking back the resources held by a process, killing it and starting it 
again with the same timestamp)

当进程释放资源时,等待资源的进程中时间戳最小(如果有)的进程将被授予资源。 (a) .僵局会出现吗?如果是,请说明如何进行。如果没有,证明它。 b) .一个过程P会饿死吗?如果是,请说明如何进行。如果没有,证明它。 答复: 说明: 这个问题的小测验

© 版权声明
THE END
喜欢就支持一下吧
点赞12 分享