Skip to content

Ticket Table Synch

Latest

Choose a tag to compare

@KBruy KBruy released this 03 Jan 16:51
79a4f09

Obecny system monitorujący sprawdza czy sąsiadujące widelce są wolne oraz czy sąsiadujący filozofowie nie jedli dawniej niż "ten chcący".

Dzięki temu usunięto FIFO, które pozwalało na jedznie tylko przez jednego filozofa na raz.

Za utrzymanie sprawieliwości odpowiada teraz system biletów. Każdy filozof po zjedzeniu otrzymuje bilet który w przypadku sytuacji gdzie dwóch filozofów może jeść ale muszą zabrać "swoje" widelce, decyduje o tym kto ma priorytet.


The current monitoring system checks whether adjacent forks are free and whether neighboring philosophers have not eaten before the "one who wants to eat."

This eliminates the FIFO system, which allowed only one philosopher to eat at a time.

A ticket system is now responsible for maintaining fairness. After each philosopher eats, they receive a ticket, which, in the event that two philosophers can eat but must take their own forks, determines who has priority.

What's Changed

  • Refactor Table and UI components for improved functionality and clarity by @KBruy in #3

Full Changelog: v.1.0...v.2.0