Skip to main content

Chapter 3 · Watch, then practise

Operating System Support

Review the process and thread abstractions used by a network service. Trace shared-memory races and explain why concurrency improves responsiveness while creating synchronization responsibilities.

3 questions · 3 with related videos. Matches are based on playlist titles; broader background matches are labeled.

What to study

  • Processes and threads
  • Blocking and concurrency
  • Shared-state synchronization

Chapter playlists

Choose a playlist

Notes

L-1.11: Process Vs Threads in Operating System

Gate Smashers · 11:17

Compares processes and threads, including their shared and separate state.

1. What threads share

Which state is shared by threads in one process, and which state is per thread?

Threads share the process address space, including code and shared data. Each has its own execution state, such as registers, program counter and stack. Separate stacks support independent function calls; they do not make shared heap updates automatically safe.

Threads in distributed system | Distributed System | Lec-37 | Bhanu Priya

Education 4u · 9:02 · Background lecture

Supplementary lecture about threads in distributed systems and concurrent service.

2. Concurrent server example

Why might a server use several threads when many requests wait on network I/O?

While one thread waits, another can serve a ready request. This can improve responsiveness even without parallel CPU execution. Shared data still needs coordination, and creating unbounded threads can exhaust memory or scheduling capacity.

aLec08 Critical Sections

Jonathan Valvano · 12:07 · Background lecture

Critical-section background from the embedded-systems course for the shared-counter race.

3. Trace a lost update

Two threads both read counter = 7, then each computes and writes counter + 1. What can happen?

Both can write 8, losing one increment; the intended result was 9. The read-modify-write sequence must be protected as one critical operation, for example with a lock or an appropriate atomic increment.

References