- 2072 Kartik · 4+2+2 marks
Threads, checkpoint, distributed commit
Short answer
Threads share process memory and are lightweight, while processes have isolated address spaces. A checkpoint saves process state to stable storage, enabling rollback recovery from the latest consistent global state without domino effect. Distributed commit ensures all participants either all commit or all abort an operation, typically using two-phase commit.
How do threads differ from process? How does checkpoint help in recovery? What does distributed commit refer to?
Threads versus process
A process has its own protected address space and resources, whereas threads are lightweight units of execution inside a process that share its address space, data and open files, but have their own stack, registers and program counter.
| Point | Process | Thread |
|---|---|---|
| Address space | Separate | Shared |
| Creation and switching | Costly | Cheap |
| Communication | IPC needed | Shared memory |
| Isolation | Strong | None |
Checkpoint in recovery
A checkpoint is a saved snapshot of the state of a process (or of the whole distributed application) on stable storage, taken periodically. If a failure occurs, the process is restarted from the latest checkpoint (rollback recovery) rather than from the beginning, so only the work since the checkpoint is lost. In a distributed system the checkpoints of processes must form a consistent global state (a recovery line, with no message received but not sent). Otherwise a rollback of one process forces others to roll back too (domino effect). Coordinated checkpointing or message logging avoids this.
Distributed commit
Distributed commit is the problem of making all the processes taking part in a distributed transaction or operation either all commit (make the changes permanent) or all abort, so that atomicity is kept. The usual solution is the two-phase commit (2PC) protocol: in phase 1 the coordinator asks all participants to vote (prepare); if all vote yes, in phase 2 the coordinator tells all to commit, otherwise to abort. Three-phase commit reduces blocking.
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Process vs threads; importance in DS · Distributed System, chapter 3 · asked 3×
- Distributed deadlock; two-phase commit · Distributed System, chapter 8
- Short note: Distributed commit · Distributed System, chapter 8
- Distributed deadlock and recovery · Distributed System, chapter 8 · asked 3×
- Short note: Two-phase commit · Distributed System, chapter 8 · asked 2×
- Short note: Three-phase commit · Distributed System, chapter 8
- Process vs thread; user and kernel threads · Operating System, chapter 2
- Data analytics process and distributed computing · Big Data Technologies, chapter 1
- Recovery from log: deferred vs immediate · Database Management System, chapter 8
- Power diode V-I and reverse recovery · Power Electronics, chapter 1