In multi-programmed systems, it is advantageous if some programs such as…
2018
In multi-programmed systems, it is advantageous if some programs such as editors and compilers can be shared by several users. Which of the following must be true of multi-programmed systems in order that a single copy of a program can be shared by several users?
I. The program is a macro
II. The program is recursive
III. The program is reentrant
- A.
I only
- B.
II only
- C.
Ill only
- D.
I, II and III
Attempted by 314 students.
Show answer & explanation
Correct answer: C
In multi-programmed systems, sharing a single copy of a program among multiple users requires the code to be reentrant. A reentrant program can be interrupted and entered again without affecting its execution by another user, as it does not modify itself and uses local storage for variables. Macros are compile-time expansions unrelated to runtime sharing, while recursion risks stack conflicts when shared without proper isolation. Therefore, reentrancy (III) is the necessary condition for safe program sharing.
A video solution is available for this question — log in and enroll to watch it.