NPTEL Operating System Fundamentals Week 8 Assignment Answers 2024

Sanket
By Sanket

NPTEL Operating System Fundamentals Week 8 Assignment Answers 2024

1. How do we describe the “starvation” situation for the “Dining Philosophers” problem?

(A) A deadlock situation where philosophers cannot make progress
(B) When a philosopher asks to share the forks from his neighbour philosophers.
(C) When a philosopher cannot pick up any forks and, therefore, cannot eat.
(D) A situation where philosophers leave the table without finishing their meal.
(E) Philosophers eating continuously without thinking

Answer :- For Answers Click Here 

2. Which of the following conditions must be satisfied for a deadlock to occur in an operating system?

(A) Mutual Exclusion
(B) Hold and Wait
(C) No Preemption
(D) Circular Wait
(E) All of the above

Answer :- For Answers Click Here 

3. Consider the following Resource Allocation Graphs (RAGs). Here p1, p2, p3, and p4 are the processes, and r1, r2, and r3 are are the resources. Each dot for a resource represents the instance of that resource type.

image 62

Choose the correct statement.

(A) The RAG in Fig. (A) has a deadlock, whereas the RAG in Fig. (B) has no deadlock.
(B) The RAG in Fig. (A) has no deadlock, whereas the RAG in Fig. (B) has a deadlock.
(C) Both the RAGs in Fig. (A) and Fig. (B) have no deadlock.
(D) Both the RAGs in Fig. (A) and Fig. (B) have deadlocks.
(E) Both the RAGs in Fig. (A) and Fig. (B) have partial deadlocks.

Answer :- For Answers Click Here 

4. Which of the following conditions describes deadlock avoidance?

(A) It ensures that a system never enters an unsafe state.
(B) Processes need not declare their maximum resource needs in advance.
(C) It allows deadlocks to occur and then handles them.
(D) It uses a resource allocation graph to detect deadlocks.
(E) It involves preempting resources from processes to break deadlocks.

Answer :- 

5. An operating system is in a safe state if

(A) Processes can be executed in some order without causing a deadlock.
(B) The corresponding resource allocation graph contains a cycle.
(C) Processes are granted resources even if they enter a deadlock situation.
(D) Processes are in a terminate state.
(E) Processes are in the suspended state.

Answer :- 

6. Which of the following functions is not a thread synchronization primitive?

(A) pthread_mutex_lock()
(B) pthread_mutex_unlock()
(C) pthread_mutex_join()
(D) pthread_mutex_destroy()
(E) pthread_mutex_rejoin()

Answer :- For Answers Click Here 

7. Assume that n is the number of vertices in the wait-for graph (single instance of each resource type). The algorithm to detect a cycle in the wait-for graph requires an order of

(A) n3 operations
(B) n operations
(C) log2n operations
(D) n2 operations
(E) nlog2n operations

Answer :- 

8. Which of the following strategies is used to recover from the deadlock situation?

(A) Terminate all the deadlock processes.
(B) Terminate one process one at atime until the deadlock cycle is removed.
(C) Increase the priority of the process to eliminate the deadlock.
(D) Deallocate the resources from all the deadlock processes and allocate them to other processes.
(E) All of the above.

Answer :- 

9. Which data structure is not needed to execute the Banker’s Algorithm?

(A) Available matrix
(B) Maximum resource matrix
(C) Allocation matrix
(D) Need matrix
(E) Prority matrix

Answer :- 

10. A computer system has four types of resources: A, B, C, and D. The system currently has 13 instances of resource A, 7 instances of resource B, 6 instances of resource C, and 7 instances of resource D available. Consider the following snapshot of a system:

image 63

Choose the correct answer.

(A) The system is unsafe and may lead to a deadlock.
(B) The system is unsafe but can automatically recover from a deadlock.
(C) The system is safe. The safe sequence is P1 -> P2 -> P3 -> P4.
(D) The system is safe. The safe sequence is P1 -> P3 -> P2 -> P4.
(E) None of the above.

Answer :- For Answers Click Here 
Share This Article
Leave a comment