Software Engineer
mediumprocess-vs-thread
What is the difference between a process and a thread?
Answer
A **process** is an independent program instance with its own memory space. A **thread** is a lightweight execution unit within a process that shares memory with other threads.
**Processes:** better isolation; IPC needed for communication.
**Threads:** cheaper context switching; need synchronization to avoid race conditions.
**Interview tip:** Mention that multi-threading can boost throughput but introduces complexity (locks, deadlocks, contention).
Related Topics
Operating SystemsConcurrency