Python Threading and Mutex Implementation

Python Threading and Mutex Implementation

Demonstrates Python multithreading with semaphores for mutual exclusion. Includes mutex checker problem detecting synchronization errors using histogram analysis. Shows practical implementation of shared variables and thread-safe counter updates.

Process Synchronization – Dining Hall Problem

Process Synchronization – Dining Hall Problem

Ensures students never dine alone with ready-to-eat and ready-to-leave states. Uses I-will-do-it-for-you pattern and scoreboard. Extended version adds ready-to-eat phase with constraints preventing solitary dining through careful state management.

Process Synchronization – Faneuil Hall Problem

Process Synchronization – Faneuil Hall Problem

Simulates citizenship ceremony with immigrants, judge, and spectators. Covers check-in process, oath confirmation, and certificate distribution with turnstile control. Extended version ensures all immigrants leave before next ceremony begins.

Process Synchronization – Senate Bus Problem

Process Synchronization – Senate Bus Problem

Explores bus boarding synchronization with 50-passenger capacity constraint. Two solutions presented: pass-the-baton pattern and I-will-do-it-for-you pattern. Bus departs only when full, with mutex protection and multiplex control.

Process Synchronization – Room Party Problem

Process Synchronization – Room Party Problem

Analyzes Dean-student synchronization where Dean searches empty rooms or breaks up parties with 50+ students. Uses turnstiles, rendezvous patterns, and pass-the-baton technique with state tracking for complex constraint enforcement.