求前辈指点。。。。。 |
[考研|报考科大软院] 2013年834真题操作系统大题求解(如图)
午夜梦回
· 发布于 2013-11-26 22:22
· 3307 次阅读
转载文章时务必注明原作者及原始链接,并注明「发表于 软院网 RuanYuan.Net 」,并不得对作品进行修改。
terry 发表于 2013-11-27 16:27 你才是大神 |
本帖最后由 antty 于 2013-11-28 10:06 编辑 antty 发表于 2013-11-27 13:25 xx兄!你敢用词再犀利点么!!! |
1.快速适应算法(分类搜索法)、伙伴系统、动态重定向分配、分页机制、分段机制 都可以。 2.没有现成答案,我来写给你吧。 semaphore model_full=0; semaphore model_empty=n; semaphore counter_full=0; semaphore counter_empty=m; semaphore model_mutex=1; semaphore counter_mutex=1; main() { cobegin chef(); waiter(); client(); coend } chef() { P(model_empty); P(model_mutex); 把原料倒入一个model; V(model_mutex); V(model_full); } waiter() { P(model_full); P(counter_empty); P(model_mutex); P(counter_mutex); 从一个model中拿出蛋糕放入一counter的空位上; V(counter_mutex); V(model_mutex); V(counter_full); V(model_empty); } client() { P(counter_full); P(counter_mutex); Buy one cake from the counter; V(counter_mutex); V(counter_empty); } 晚安小伙伴。 |
点评
大神指点,如醍醐灌顶,拨云见月,膜拜激动Ing。。。。。。
评分
vo_ 发表于 2013-11-27 23:42 已经很保守了 不忍直视啊 |