Explain why a Micro-Kernel architecture is one of the easiest OS structures to extend to a distributed system.
What are the various fields that need to be saved in a process control block (PCB)? Do we have to save the general purpose registers? Why or why not?
In class, we noted that the Dispatcher()
function
does not return in the normal fashion. What did we mean by that?
What are the possible outputs when the following code is compiled and run simultaneously in two separate processes on a Unix system?
#include < stdio.h > #include "shm.h" /* for our shared mem/sem primatives */ int main(int argc, char *argv[]) { int *num; num = (int *) shmattach(3013); if (num == NULL) { num = (int *) shmcreate(3013, sizeof(int)); *num = 0; } *num = *num + 1; printf("%d\n", *num); }
Five processes are ready to run. Their CPU burst times are 5, 12, 1, 7 and 2. In what order are they run under a FCFS 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?
Modify Peterson's Solution as shown in class to properly synchronize 3 processes instead of only 2. You can add shared variables as needed.
True or False:
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?
Modify the dining philosopher's solution shown in class to have the "odd" philosophers pick up their "left" forks first and the "even" philosophers pick up their "right" forks first. Does this solve the problem of potential deadlock?
Threads are often called "lightweight" processes. Why? What is "light" about them?