How to Use

The simulation's view has three buttons. One of them relates itself to the producer, "Step Producer". When clicked, it executes the highlighted line of the producer's code - the highlight on a given line indicates that it is next to be executed. Another button, "Step Consumer", behaves in the same way, although for the consumer process. At last, the third button, "Step Back", undoes the last execution that was made. The simulation's flow boils down to updating accordingly the buffer's state, the count variable's value - whose job is to keep track of the amount of items stored in the buffer -, the next lines to be executed and the consumer and producer processes' status, which can be "ready", "executing", or "blocked".

When using the simulation, the user enters the role of a process scheduler. This is one of the topics that the simulation illustrates and can help the user to comprehend, besides the semantics of sleep and wakeup syscalls, its' use for process synchronization, race condition scenarios, the origin for the need of semaphores, and others.