Threading and Concurrency Day!
- Assigned Reading
- You're reading all of Section 12.1 and Sections 12.3 through Sections 12.8 right now, skipping those subsections that refer to networking and servers.
- Chapter 12 is actually the fourth chapter of the reader.
- Code examples are in C, but the concepts are largely the same regardless of language.
- Once we learn networking, we'll come back and hit on some of these excluded sections.
- Today's Agenda
- Work through the ticket-agents example, pointing out why all but the final version are flawed and capable of producing erroneous results.
- Speak about the canonical Dining Philosophers concurrency example, which is taught in virtually every course that teaches multithreading and concurrency.
- We'll implement a total of four dining philosophers simulations.
- Each one will advance us toward a better solution that relies on multithreading while ensuring that minimal CPU is wasted by threads unable to get any meaningful work done.