題目有點多..有沒有大大對任何一題有想法的
可以分享一下嗎?
謝謝
1. What is the purpose of upcall? [5%] If your OS does not support upcall such
as Linux, how do you implement the same function of upcall? [5%]
2. Vitualization enables multiple OSes running simultaneously on a physical
machine. What is "system consolidation" in a virtualized environment? [5%]
In what situation, we still need one OS running on a virtualized
environment? [5%]
3. In what situations, thread pool is not beneficial? [5%] Give example
application for each situation? [5%]
4. Why timestamp-based protocol ensures conflict serializability? [5%]
Why it also ensures freedom from deadlock? [5%] Hint: what cause
conflicting operations and which in the four deadlock condictions can the
protocol break?
5. The following codes with semaphores can be used to implement a monitor for
synchronization, where F is an external procedure, x is a condition
variable. Explain the purposes of using semaphores next [5%] and x-sem[5%]?
semaphore mutex; // (initially = 1)
semaphore next; // (initially = 0)
int next-count = 0;
semaphore x-sem; // (initially = 0)
int x-count = 0;
wait(mutex);
...
body of F;
...
if (next-count > 0)
signal(next);
else
signal(mutex);
----------------------------------------
x.wait()
┌───────────────┐
│x-count++; │
│if (next-count > 0) │
│ signal(next); │
│else │
│ signal(mutex); │
│wait(x-sem); │
│x-count--; │
└───────────────┘
x.signal()
┌───────────────┐
│if (x-count > 0) { │
│ next-count++; │
│ signal(x-sem); │
│ wait(next); │
│ next-count--; │
│} │
└───────────────┘
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.118.110.186