0
0
Operating Systemsknowledge~20 mins

Process vs thread in Operating Systems - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Process vs Thread Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Difference in resource allocation between process and thread

Which of the following best describes how resources are allocated between a process and a thread?

AThreads have separate memory spaces, but processes share the same memory space.
BProcesses share memory space, but threads have their own separate memory spaces.
CEach process has its own memory space, while threads within the same process share the same memory space.
DBoth processes and threads share the same memory space and resources equally.
Attempts:
2 left
💡 Hint

Think about how multitasking works in your computer and how programs run independently.

📋 Factual
intermediate
2:00remaining
Execution context of process vs thread

What is the main difference in execution context between a process and a thread?

ABoth processes and threads have their own execution context including program counter and stack.
BThreads have their own execution context including program counter and stack, while processes do not.
CA process has its own execution context including program counter and stack, while threads share the same execution context.
DNeither processes nor threads have an execution context.
Attempts:
2 left
💡 Hint

Consider what allows a thread or process to run independently.

🔍 Analysis
advanced
2:00remaining
Impact of thread failure vs process failure

What typically happens when a thread fails compared to when a process fails?

AIf a thread fails, it crashes only that thread; if a process fails, it crashes only that process without affecting others.
BIf a thread fails, it usually crashes the entire process; if a process fails, it crashes only itself without affecting others.
CIf a thread fails, it crashes the entire system; if a process fails, it crashes only that thread.
DIf a thread fails, it crashes only that thread; if a process fails, it crashes the entire system.
Attempts:
2 left
💡 Hint

Think about isolation and how errors propagate in multitasking systems.

Comparison
advanced
2:00remaining
Overhead comparison between creating a process and a thread

Which statement correctly compares the overhead of creating a process versus creating a thread?

ACreating a thread and a process have the same overhead because both require separate memory allocation.
BCreating a process has less overhead than creating a thread because processes are lighter weight.
CCreating a process has no overhead, but creating a thread requires significant overhead.
DCreating a thread has less overhead than creating a process because threads share resources with their parent process.
Attempts:
2 left
💡 Hint

Consider what resources need to be allocated when starting a new process or thread.

Reasoning
expert
2:00remaining
Choosing between process and thread for a web server

A web server needs to handle many simultaneous client requests efficiently. Which approach is generally better and why?

AUsing a single process with no threads is better to avoid complexity and overhead.
BUsing multiple threads is better because threads share memory and can communicate faster, improving performance.
CUsing multiple processes is better because each process is isolated, preventing one request from affecting others.
DUsing a single thread per request is better because it avoids context switching.
Attempts:
2 left
💡 Hint

Think about performance and resource sharing in handling many tasks at once.