Concurrency
Explore the concept of concurrency in operating systems and multi-threaded programs. Understand the causes of unexpected behavior when multiple threads modify shared data and learn the fundamental challenges in building correct concurrent programs.
We'll cover the following...
Another main theme of this course is concurrency. We use this conceptual term to refer to a host of problems that arise, and must be addressed, when working on many things at once (i.e., concurrently) in the same program. The problems of concurrency arose first within the operating system itself; as you can see in the examples on virtualization, the OS is juggling many things at once, first running one process, then another, and so forth. As it turns out, doing so leads to some deep and interesting problems.
Multi-threaded programs
Unfortunately, the problems of concurrency are no longer limited just to the OS itself. Indeed, modern multi-threaded programs exhibit the same problems. Let us demonstrate with an example of a multi-threaded program:
Although you might not fully understand this example at the moment (and we’ll learn a lot more about it ...