All Exams Test series for 1 year @ ₹349 only
Question

Given below are two statements : one is labelled as Assertion (A) and the other is labelled as Reason (R).
Assertion (A) : Preemptive scheduling can lead to race conditions in critical section.
Reason (R) : Preemption allows multiple processes to access shared data simultaneously.
In the light of the above statements, choose the most appropriate answer from the options given below :

The correct answer is
(A) is correct but (R) is not correct

Analyzing Assertion (A): Preemptive Scheduling and Race Conditions

Assertion (A) states that preemptive scheduling can lead to race conditions in a critical section. This statement is considered correct. Preemptive scheduling allows an operating system to interrupt a running process and allocate the CPU to another process. If a process is interrupted while executing a critical section (code accessing shared resources) without proper synchronization mechanisms (like mutexes or semaphores), and another process gains control, it might access the same shared data. This interleaving, especially if the first process's operation on shared data is incomplete, can lead to unpredictable results and race conditions.

Evaluating Reason (R): Preemption and Simultaneous Access

Reason (R) claims that preemption allows multiple processes to access shared data simultaneously. This statement is incorrect. Preemption fundamentally leads to *interleaved* execution, not simultaneous access. While multiple processes might run *concurrently* (on a single CPU via time-sharing) or in *parallel* (on multiple CPUs), preemption specifically refers to the OS forcibly pausing a process. This pause enables context switching, allowing another process to run. It doesn't inherently permit two processes to access the same data at the exact same moment. Simultaneous access requires multiple processing units, and even then, careful synchronization is needed. The core issue with preemption in critical sections is the potential for unsafe *interleaving* of operations, not simultaneous access.

Conclusion

Since Assertion (A) accurately describes a potential consequence of preemptive scheduling in the context of critical sections, and Reason (R) provides an incorrect explanation about simultaneous access, the most appropriate choice is that (A) is correct, but (R) is not correct.

Was this answer helpful?

Important Questions from Miscellaneous

  1. Which of the following scheduler/schedulers is/are also called CPU scheduler ?
    (A). Short Term Scheduler
    (B). Long Term Scheduler
    (C). Medium Term Scheduler
    (D). Asymmetric Scheduler
    Choose the correct answer from the options given below:
  2. A situation where two or more processes are blocked, waiting for resources held by each other is called:
  3. External fragmentation occurs ________.
  4. Which disk scheduling algorithm looks for the track closest to the current head position?
  5. Which CPU scheduling algorithm prefers the process with the shortest burst time?
Need Expert Advice?

Start Your Preparation with Prepp Mobile App

Download the app from Google Play & App Store
Download the app from Google Play & App Store
Prepp Mobile App