2dbi

Process vs. thread

viaGlassdoor

Explain the difference between a process and a thread, and where each is appropriate.

Be ready to discuss

  • Address space and memory: processes have isolated address spaces; threads share the address space of their parent process.
  • Resources and overhead: process creation and context switching are heavier; threads are lighter and share file descriptors, heap, and globals.
  • Communication: inter-process communication (pipes, sockets, shared memory) vs. direct shared-memory communication between threads.
  • Concurrency hazards: race conditions and the need for synchronization (locks, mutexes) among threads; fault isolation favouring processes.
  • When to use which: CPU/fault isolation -> processes; lightweight parallelism with shared state -> threads.
Add a follow-up question they asked
No follow-ups yet. Be the first to add one.
asked …
LeaderboardSalary
Language
Account