a. Write a monitor solution to the dinning-philosopher problem.
b. Provide two programming examples in which multithreading provides better performance than a single-threaded solution.
c. Many CPU-scheduling algorithms are parameterized. For example,
the Round Robin algorithm requires a parameter to indicate the time
slice. Multilevel feedback queues require parameters to define the
number of queues, the scheduling algorithms for each queue, the criteria
used to move processes between queues and so on. These algorithms
are thus really sets of algorithms (for example, the set of RR algorithms
from all time slices, and so on). One set of algorithms may include
another (for example, the FCFS algorithm is the RR algorithm with
an infinite time quantum). What (if any) relation holds between the
following pairs of sets of algorithms?
i. Priority and SJF
ii. Multilevel feedback queues and FCFS
iii. Priority and FCFS
iv. RR and SJF
Question 2:
a. Consider the following snapshot of a system: -
Answer the following questions using Banker's algorithm:
i. What is the content of the matrix need?
ii. Is the system in a safe state?
iii. If a request from P1 arrives for (0, 4, 2, 0), can the request
be granted
immediately?
b. Consider the following page-reference string:
1, 2, 3, 4, 2, 1, 5, 6, 2, 1, 2, 3, 7, 6, 3, 2, 1, 2, 3, 6
How many page faults would occur for following replacement algorithms
assuming one, two, three, four, five, six or seven frames? Remember
that all frames are initially empty, so your first unique pages will
all cost one fault each.
i. LRU replacement.
ii. FIFO replacement.
iii. Optimal replacement.
Question 3:
a. The Linux kernel does not allow paging out kernel memory. What effect does this restriction have on kernel design? What are two advantages and two disadvantages of this design decision?
b. The Windows 2000 VM manager uses a two-stage process to allocate memory. Identify several ways in which this approach is beneficial.
