Deadlock: Detection, Prevention & the Dining Philosophers
Five philosophers sit at a circular table with five forks, one between each pair. Each philosopher alternates between thinking and eating (needing two forks). Design a solution that allows all philosophers to eat without deadlock.
Enable JavaScript for the full StreamPrep guide.