Operating systems concept: Procedures that can be safely shared by multiple tasks concurrently without modification are called what?

Difficulty: Easy

Correct Answer: reentrant procedures

Explanation:


Introduction / Context:
In multitasking systems, several threads or processes may call the same routine at the same time. Some procedures are designed to be safely invoked concurrently without corrupting state. Knowing the correct term is fundamental for systems, embedded, and real-time programming.


Given Data / Assumptions:

  • Multiple callers may enter the same routine simultaneously.
  • No global writable state is assumed inside the routine, or such state is properly protected.
  • Code must not self-modify.


Concept / Approach:
A reentrant procedure can be paused and safely re-entered by another thread/task because it uses no shared, modifiable global data without protection, does not rely on static non-const state, and keeps all temporary data on the stack or in caller-provided storage. Reentrancy is stricter than mere “thread-safety.”


Step-by-Step Solution:

Identify the property: safe concurrent use of the same code body.Relate to implementation: no self-modifying code; local automatic storage; immutable code segment.Name the concept: “reentrant procedures.”Reject imprecise alternatives that do not address concurrency correctness.


Verification / Alternative check:
Classic OS texts define reentrancy for library routines used by interrupts or multiple tasks (e.g., ISR-safe functions must be reentrant).


Why Other Options Are Wrong:
Serially usable: implies one-at-a-time, not concurrent. Concurrent procedures: vague; does not guarantee safety. Topdown procedures: relates to design style, not concurrency. None: incorrect since “reentrant” is the established term.


Common Pitfalls:
Equating “thread-safe” with “reentrant” in all cases; relying on hidden globals (e.g., errno-like variables) without protection.


Final Answer:
reentrant procedures

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion