UFMG - Pós-graduação em Ciência da Computação - Programação Paralela

A seguir: Conclusão Acima: The Drinking Philosophers Problem[#!Drinking!#] Anterior: Filósofos Sedentos: o Grafo


Algoritmo para Filósofos Sedentos

R1
Requisitando uma garrafa:
thirsty, need(b), reqb(b), $\neg bot(b)$ $\rightarrow$
send request token for bottle b;
reqb(b) := false

R2
Enviando uma garrafa:
reqb(b), bot(b), $\neg [need(b) \wedge (drinking \vee fork(f))]$ $\rightarrow$
send bottle b;
bot(b) := false

R3
Recebendo uma requisição por garrafa:
receive(request(b)) $\rightarrow$
reqb(b) := true

R4
Recebendo uma garrafa:
receive(bottle(b)) $\rightarrow$
bot(b) := true



Osvaldo Carvalho