Explain why a Micro-Kernel architecture is, in theory, more robust than a Monolithic-Kernel architecture. Is Windows-NT a true Micro-Kernel? Explain why or why not.
Select all relevant choices from the list below. The notion of "platform dependence" for various software packages comes from the fact that:
Critical region access:
Consider the multiprocess SOS solution we looked at (use-proc-table.c
).
Explain why "busy waiting" is acceptable in order to gain access
to the process control block.
Why is it (often) faster to context switch between threads than
it is to context switch between processes? Be specific. (Hint: see
system-thread.h
).
In class, we noted that sometimes the Dispatcher()
function causes the OS to execute "while (1) { /* no op */
}
". When and why does it do this?
Consider compiling and running the following code on a Unix system:
#include < stdio.h > int num; int main() { num = 1; fork(); num = num + 1; printf("%d\n", num); }
fork()
call was changed to a system
called, say spawn()
that created a new thread
instead of a new process. Now, what are the possible outputs?
Four processes are ready to run. Their CPU burst times are 10, 2, 4 and 1. In what order are they run under a SJF scheduling algorithm? What is the average waiting time? How close is this to the best average waiting time we could have had for these processes? What is the throughput?
True or False:
Test_and_Set()
and semaphores are essentially the same.
wait()
call.
In the dining philosopher's solution shown in class, suppose philosopher 2 was absentminded and never let go of his left fork, even while thinking. If all the other philosophers behaved normally and kept thinking and eating, what would be the eventual outcome of the system?
Suppose we tried to modify the Readers/Writers synchronization solution we saw in class to "favor" writers instead of readers:
Writer: wait(mutex2); writecount++; signal(mutex2); wait(wrt); /* critical region */ signal(wrt); wait(mutex2); writecount--; signal(mutex2); Reader: wait(mutex2); if (writecount) wait(wrt); wait(signal2); wait(mutex); readcount++; if (readcount == 1) wait(wrt); signal(mutex); /* critical region */ wait(mutex); readcount--; if (readcount == 0) signal(wrt); signal(mutex);Does this work? Why or why not?
Consider your Project
1. Which of the following fields in the Linux struct
task_struct
(greatly condensed, here) could be used to solve
the problem:
struct task_struct { volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ long counter; long priority; int pid; };Briefly explain how they could be used.