Class Philosopher
In: karel/philosopher.rb
Parent: Robot

A class of robots that can execute the dining philosophers protocol. Demonstrates unchecked concurrency so deadlock can result.

Methods

eat   get_forks   new   put_forks   run_task   think  

Included Modules

Turner

Public Class methods

create a new Philosopher that will run in its own thread

Public Instance methods

eat by moving in to the table

get two forks (beepers) to enable eating

return the two forks so as to return to thinking

The task for one philosopher (run in the thread)

Think by moving awauy from the "table"

[Validate]