A Tool for Visualizing Classic Concurrency Problems

Adam Yakes,Samantha S. Foley
DOI: https://doi.org/10.1145/3408877.3439544
2021-03-03
Abstract:Concurrency and synchronization are new concepts for most undergraduate students. Writing multi-threaded programs presents new challenges in the form of brand new problems like race conditions, starvation, and deadlock. Classic synchronization problems are often used to teach these concepts with concrete sets of actors and goals. In this demo, we present a web application that allows students to execute multiple solutions with varying parameters to four common synchronization problems: Dining Philosophers, Bounded Buffer (Producer-Consumer), Readers Writers, and Unisex Bathroom as presented in the Little Book of Semaphores by Allen B. Downey (greenteapress.com/wp/semaphores/). The demo will show how students can manipulate options for: the number of threads; time to do work; time between work periods; as well as how the state of the system can be observed through visual animations. These animations can be used to observe deadlock, and overall statistics highlight starvation. The interactive nature of the tool allows students to explore the tradeoffs between different solutions, and how the parameters of a problem impact performance, resource utilization, and likelihood of deadlock.
What problem does this paper attempt to address?