Q: Consider the following POSIX signal example code. Can you elaborate how to design the kernel to support it?
Signal registration: 對 signal 註冊 user 指定的 handler。kernel 將之紀錄在 task structure 中
Signal generation: 產生 signal 時,kernel 將之記在 task structure
Signal delivery: 當 process trap 進 kernel 時,kernel 檢查 task structure 上的 pending signal,並執行註冊的 handler
Q2
Q: Can you prevent all possible context switch by disabling interrupt?
如果所有可能的 interrupt 都關掉且 process 不主動 call schedule。
Q3
Q: Do you think microkernel need to be preemptive kernel or not? Why or why not?
Maybe not.
microkernel-based systems rely on very fast IPC operations, typically provided by IPC fastpaths[Lie93]. A fastpath usually improves IPC times by orders of magnitude,as it handles only the most commonly executed operations, deferring other operations to the conventional slowpath. As adding preemption points in a code path increases its uninterrupted execution time, making the IPC fastpath preemptible would significantly degrade average-case performance.