Step 1: Definition of the Dining Philosopher Problem.
The Dining Philosopher problem is a synchronization problem that models the situation where multiple philosophers share a set of resources (e.g., forks), but need to avoid deadlock and ensure that they can eat in turn.
Step 2: Use of semaphores.
Semaphores are used in operating systems to manage synchronization. In the Dining Philosopher problem, semaphores can be used to ensure that only one philosopher can pick up a fork at a time, thus avoiding deadlock and ensuring mutual exclusion.
Step 3: Explanation of other options.
- (2) Use of overlays: Overlays refer to a technique in memory management and are not relevant to the solution of the Dining Philosopher problem.
- (3) Mutual exclusion: While mutual exclusion is required to avoid deadlock, semaphores specifically are used to enforce this in the context of the Dining Philosopher problem.
- (4) Bounded waiting: Bounded waiting ensures that no process waits indefinitely, but it is not the primary solution to the problem.
Step 4: Conclusion.
The correct answer is **(1) Use of semaphores**, which ensures that philosophers can safely pick up and put down forks without causing deadlock.
In C language, mat[i][j] is equivalent to: (where mat[i][j] is a two-dimensional array)
Suppose a minimum spanning tree is to be generated for a graph whose edge weights are given below. Identify the graph which represents a valid minimum spanning tree?
\[\begin{array}{|c|c|}\hline \text{Edges through Vertex points} & \text{Weight of the corresponding Edge} \\ \hline (1,2) & 11 \\ \hline (3,6) & 14 \\ \hline (4,6) & 21 \\ \hline (2,6) & 24 \\ \hline (1,4) & 31 \\ \hline (3,5) & 36 \\ \hline \end{array}\]
Choose the correct answer from the options given below:
Match LIST-I with LIST-II
Choose the correct answer from the options given below:
Consider the following set of processes, assumed to have arrived at time 0 in the order P1, P2, P3, P4, and P5, with the given length of the CPU burst (in milliseconds) and their priority:
\[\begin{array}{|c|c|c|}\hline \text{Process} & \text{Burst Time (ms)} & \text{Priority} \\ \hline \text{P1} & 10 & 3 \\ \hline \text{P2} & 1 & 1 \\ \hline \text{P3} & 4 & 4 \\ \hline \text{P4} & 1 & 2 \\ \hline \text{P5} & 5 & 5 \\ \hline \end{array}\]
Using priority scheduling (where priority 1 denotes the highest priority and priority 5 denotes the lowest priority), find the average waiting time.