Write (in pseudocode) an implementation of virtual clocks,including the queuing and management of timer requests for the kemel and applications.Assume that the hardware provides three timer channels.
Each channel would run the following algorithm:
/* * data definitione * * /
// a list of interrupte sorted by earlleat-time-first order
List interruptList
Timer timer
while [true) {
/* * An interrupt will occur at time timer aetTime .*/
/* * now wait for the timer interrupt
i.e.for the timer to expire **/
notify( requeatlist.next() );
}
这道题你会答吗?花几分钟告诉大家答案吧!
扫描二维码,关注牛客网
下载牛客APP,随时随地刷题
Each channel would run the following algorithm:
/* * data definitione * * /
// a list of interrupte sorted by earlleat-time-first order
List interruptList
Timer timer
while [true) {
/* * An interrupt will occur at time timer aetTime .*/
/* * now wait for the timer interrupt
i.e.for the timer to expire **/
notify( requeatlist.next() );
}