01Overview
In the 1960s Multics introduced the process as the unit of resource isolation: each process has its own address space and file descriptors. In the 1970s Unix made process creation a cheap system call with fork/exec. In the 1980s Mach pushed the thread model: several flows of execution inside one process share memory and switch more cheaply.
Threads brought race conditions and locks, and with them deadlock. Operating systems provide mutexes, condition variables and semaphores; languages try to lower the difficulty with actors, CSP and async/await. In the multicore era concurrency is no longer a server-only problem: every layer of software faces it.
02History
- 1965
The Multics process model
Address spaces and resource isolation.
- 1971
Unix fork/exec
Lightweight process creation.
- 1985
The Mach microkernel
User-level threads and message passing.
- 1995
Threads built into Java
Concurrency enters a mainstream language.
- 2005
Multicore goes mainstream
Concurrency becomes a general programming problem.
03Core concepts
Processes and threads
The first owns an address space; the second shares its process’s resources.
Context switch
Saving and restoring execution state — the fixed cost of concurrency.
Deadlock
Threads wait on locks held by each other, forming a cycle.
04Hands-on
Do it once — it beats reading it ten times
Write a program that deadlocks on two mutexes, then fix it with a lock ordering and prove the order holds
05Self-check
Say it in your own words first, then open the answer. Whatever you cannot explain is what to review next.
Can you explain "Processes and threads"?
The first owns an address space; the second shares its process’s resources.
Can you explain "Context switch"?
Saving and restoring execution state — the fixed cost of concurrency.
Can you explain "Deadlock"?
Threads wait on locks held by each other, forming a cycle.
What problem did it solve, and why was there nothing better at the time?
Go back to the history section: how was this done before, and what did it cost?
If you had to build it today, how would you break it down?
Use the hands-on task above: write a plan of at most three steps before you start.
06Key people
Ken Thompson
1943 –
Implemented the Unix process model.
Leslie Lamport
1941 –
Concurrency theory and distributed systems.
07Further reading
- Operating Systems: Design and Implementation
- Java Concurrency in Practice