/TheDiningPhilosophers

The Dining Philosophers

Primary LanguageJava

The Dining Philosophers | O Jantar dos Filósofos

This is a programming project in the Java language that portrays a well-known problem in the study of Concurrent Systems: The Philosophers' Dinner (with some changes from the English "TheDiningPhilosophers" - "The Dinner Philosophers").

The problem presented is built on a dinner table generally composed of five philosophers, five plates of food and five forks available for use.

Here, forgetting a little about etiquette (and common sense) and considering that all philosophers do in a social gathering, in a restaurant, is think and eat, our hungry thinkers need to take turns with the five available forks so that, at every moment, can eat using two of them.

That said, everyone should enjoy it while their neighbors (the philosophers on the left and right) are busy thinking so they can eat.

You are invited to test the program and observe in practice the table of our intellectual masters in its standard configuration or in the one you wish to establish through the control panels.

------------------------------------------------------------------------------------------------------------------------------------------------------------

Este é um projeto de programação na linguagem Java que retrata um problema muito conhecido no estudo de Sistemas Concorrentes: O Jantar dos Filosofos (com algumas alterações do inglês "TheDiningPhilosophers" - "Os Filósofos do Jantar").

O problema apresentado se constrói sobre uma mesa de jantar composta geralmente por cinco filósofos, cinco pratos de comida e cinco garfos disponíveis para uso.

Aqui, esquecendo um pouco a etiqueta (e o bom senso) e considerando que tudo que filósofos fazem num encontro social, em um restaurante, é pensar e comer, nossos famintos pensadores precisam revezar os cinco garfos disponíveis para que, a cada instante, possam comer utilizando dois deles.

Dito isso, cada um deve aproveitar enquanto seus vizinhos (os filósofos da esquerda e direita) estiverem ocupados pensando para que possa comer.

Esteja convidado a testar o programa e observar na prática a mesa de nossos mestres intelectuais em sua configuração padrão ou na que você mesmo desejar estabeler através dos paineis de controle.

------------------------------------------------------------------------------------------------------------------------------------------------------------