Bird
Raised Fist0

You are designing a web server that must handle thousands of simultaneous client requests efficiently. Which approach is most suitable to maximize resource sharing and minimize overhead?

easy🔍 Pattern Recognition Q11 of Q15
Operating Systems - Process vs Thread - Key Differences
You are designing a web server that must handle thousands of simultaneous client requests efficiently. Which approach is most suitable to maximize resource sharing and minimize overhead?
AUse multiple threads within a single process to handle client requests concurrently
BUse multiple processes with shared memory segments for communication
CUse a single-threaded process with blocking I/O for all requests
DUse multiple processes, each handling a single client request independently
Step-by-Step Solution
  1. Step 1: Understand resource sharing in threads

    Threads within the same process share memory and resources, allowing efficient communication and lower overhead compared to processes.
  2. Step 2: Compare overhead of context switching

    Thread context switching is lighter than process context switching, making threads better for high concurrency.
  3. Step 3: Evaluate options

    Use multiple processes, each handling a single client request independently uses processes, which have higher overhead and less efficient resource sharing. Use a single-threaded process with blocking I/O for all requests is single-threaded and blocks, limiting concurrency. Use multiple processes with shared memory segments for communication adds complexity with shared memory and still has process overhead.
  4. Final Answer:

    Option A -> Option A
  5. Quick Check:

    Threads maximize resource sharing and minimize overhead for concurrent tasks [OK]
Quick Trick: Threads share memory; processes isolate resources [OK]
Common Mistakes:
MISTAKES
  • Assuming processes are always better for concurrency
  • Ignoring context switching overhead differences
  • Believing shared memory between processes is as simple as threads
Trap Explanation:
PITFALL
  • Processes provide isolation but at the cost of overhead; threads share memory but require careful synchronization.
Interviewer Note:
CONTEXT
  • Tests candidate's ability to recognize when threads are preferable over processes for concurrency and resource sharing.
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