Bird
Raised Fist0

A candidate claims that threads are always safer than processes because they share the same memory space and can easily communicate. What is the flaw in this reasoning?

medium🐞 Bug Identification Q7 of Q15
Operating Systems - Process vs Thread - Key Differences
A candidate claims that threads are always safer than processes because they share the same memory space and can easily communicate. What is the flaw in this reasoning?
AThreads have separate memory spaces, so sharing is limited.
BShared memory increases the risk of data corruption without proper synchronization.
CProcesses cannot communicate at all, so threads are always safer.
DProcesses are slower, so safety is compromised.
Step-by-Step Solution
Solution:
  1. Step 1: Understand shared memory risks

    Threads share memory, which requires synchronization to avoid data races and corruption.
  2. Step 2: Analyze candidate's claim

    Claim ignores synchronization needs, leading to unsafe behavior.
  3. Step 3: Evaluate options

    Shared memory increases the risk of data corruption without proper synchronization correctly identifies the flaw: shared memory can cause corruption without synchronization.
  4. Final Answer:

    Option B -> Option B
  5. Quick Check:

    Shared memory requires synchronization for safety [OK]
Quick Trick: Shared memory needs synchronization to be safe [OK]
Common Mistakes:
MISTAKES
  • Believing processes cannot communicate
  • Thinking threads have separate memory spaces
Trap Explanation:
PITFALL
  • Candidates confuse communication ease with safety, ignoring synchronization complexity.
Interviewer Note:
CONTEXT
  • Identifies misconceptions about thread safety and shared memory.
Master "Process vs Thread - Key Differences" in Operating Systems

2 interactive learning modes - each teaches the same concept differently

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Operating Systems Quizzes