Quiz Space

Operating Systems · Quiz 2 · 23 Nov 2025 · September 2025 term

Question 13: Assume that context switches can occur at any time durin…

Question 13

+4 marksOne or more correct options

Assume that context switches can occur at any time during the execution of the following code snippet. The variable counter is shared between two programs. Which of the following can be the possible final values of counter?

Initial value of counter =100=100

python
# Program A
R1 = counter
R1 = R1 + 10
counter = R1
# Program B
R2 = counter
R2 = R2 - 30
counter = R2

Select all that apply.

  1. A

    70

  2. B

    80

  3. C

    90

  4. D

    100

  5. E

    110

  6. F

    120

Show answer

Correct answers

  • A

    70

  • B

    80

  • E

    110

Question 13 of 17 in the IIT Madras BS Operating Systems (Operating Systems) Quiz 2 paper sat on 23 Nov 2025, in the September 2025 term (IIT M DEGREE AN EXAM QDB2 23 Nov 2025 NEW). It carries 4 marks.

This question was also asked in

More questions from this paper

  1. Q1Consider the following scenario where two processes are sharing a common variable. Global setup Process 1 Process 2 Whi…
  2. Q2Figure question
  3. Q3Figure question
  4. Q4Figure question
  5. Q5State True or False: In inter-process communication (IPC) using shared memory, the commonly used system calls are send …
  6. Q6Figure question
  7. Q7Identify the correct system call that should be used at LINE-1 to execute the grep command in the following code:
  8. Q8Figure question
  9. Q9What is a disadvantage associated with the Shortest Job First (SJF) scheduling algorithm in operating systems?
  10. Q10In the context of response time, which of the following statements is correct for the First-Come- First-Serve (FCFS) an…
  11. Q11Select all the correct statements
  12. Q12Choose all the correct statements regarding compiling and linking multiple C source files using gcc.
  13. Q14Consider the following code snippet from Bakery Algorithm. critical section Considering that there are 5 processes, and…
  14. Q15Figure question
  15. Q16Figure question
  16. Q17Figure question