Visualization of dining philosophers problem in your browser.
- Web workers are assigned for each philosoher to emulate their behavior.
- Chopstick data is shared between workers by using SharedArrayBuffer and Atomics api.
- think random amount of time (0 ~ 500ms)
- pick up left chopstick
- (wait 150ms to observe deadlock easily)
- pick up right chopstick
- eat random amout of time (0 ~ 500ms)
- put down right chopstick
- put down left chpstick
- repeat from the beginning
To change this behavior, please edit worker.js