Systems software property: System programs such as compilers are typically designed to be what kind of code so they can be shared safely by multiple processes in memory?

Difficulty: Easy

Correct Answer: reenterable

Explanation:


Introduction / Context:
Operating systems often allow multiple processes to use the same program code in memory to save RAM and improve performance. For this to work safely, the code must satisfy specific constraints so that simultaneous entries do not corrupt state.



Given Data / Assumptions:

  • System programs include compilers, assemblers, linkers, and utilities.
  • Multiple invocations may run concurrently or be interruptible.
  • The desired property allows safe sharing and re-entry into the same code.


Concept / Approach:

Reenterable (pure) code is position-independent, contains no self-modifying instructions, and keeps mutable data in separate data segments or per-process stacks. This allows the OS to map one copy of the executable code pages into many processes, reducing memory footprint and avoiding interference among them.



Step-by-Step Solution:

Identify property needed for safe concurrent execution: reentrancy.Recall that reenterable code does not modify its text segment.Recognize that compilers and system tools are designed as such to be shared.Choose “reenterable.”


Verification / Alternative check:

Modern shared libraries and OS loaders rely on reentrancy and relocation to share code segments and keep writable state separate (copy-on-write data pages if needed).



Why Other Options Are Wrong:

  • Non reusable / serially usable: contradict sharing and concurrency goals.
  • Recursive: refers to an algorithmic technique, not a memory-sharing property.


Common Pitfalls:

Confusing “thread-safe” with “reenterable” (related but not identical); assuming all code can be shared without considering writable static data or global state.


Final Answer:

reenterable

Discussion & Comments

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