Philosophe

Vianney DOLEANS / Antoine FORET

Sommaire

  • Le projet
  • Synchronisation initiale
  • Gestion des actions

Le projet

"A group of philosophers has decided to start a new theory, dictating a group of rules about sharing natural resources that prevents famishment around the world."

Synchronisation initiale

Creation des threads

Execution

Gestion des actions

EAT

THINK

REST

(1 << 2) = 0100

(1 << 1)  = 0010

(1 << 0) = 0001

penser et manger

EAT | THINK => 0110

 

EAT                => 0100

THINK           => 0010

EAT | THINK => 0110 

A t'on le droit de dormir ?

(EAT | THINK) & REST = 0110 & 0001

 

0110

& 0001

0000

Gestion des actions

EAT

THINK

REST

(1 << 2) = 0100

(1 << 1)  = 0010

(1 << 0) = 0001

penser et manger

EAT | THINK => 0110

 

EAT                => 0100

THINK           => 0010

EAT | THINK => 0110 

A t'on le droit de manger ?

(EAT | THINK) & EAT = 0110 & 0100

 

0110

& 0100

0100

Des questions ?

Philosophe

By foret_a

Philosophe

  • 343