Forks

libretto.examples.diningPhilosophers.Forks
trait Forks

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ForksProvider.type

Members list

Concise view

Type members

Types

A fork that has been successfully picked up and can be used. It represents exclusive access to a fork.

A fork that has been successfully picked up and can be used. It represents exclusive access to a fork.

Attributes

Interface to a fork. The fork itself may be shared among multiple philosophers, in which case multiple SharedFork interfaces are created for one "physical" fork. These SharedForks then have to coordinate when accessing the underlying "physical" fork. Once SharedFork is successfully picked up from the table (see tryPickUp), the holder of the resulting HeldFork can use it to eat.

Interface to a fork. The fork itself may be shared among multiple philosophers, in which case multiple SharedFork interfaces are created for one "physical" fork. These SharedForks then have to coordinate when accessing the underlying "physical" fork. Once SharedFork is successfully picked up from the table (see tryPickUp), the holder of the resulting HeldFork can use it to eat.

Attributes

Value members

Abstract methods

def letGo: SharedFork -⚬ Done

Gives up access to the fork.

Gives up access to the fork.

Attributes

Releases the fork so that it can be acquired by others.

Releases the fork so that it can be acquired by others.

Attributes

Attempts to pick up a shared fork. If successful, outputs HeldFork on the left. Does not wait for the shared fork to become available. If it is unavailable, outputs SharedFork on the right.

Attempts to pick up a shared fork. If successful, outputs HeldFork on the left. Does not wait for the shared fork to become available. If it is unavailable, outputs SharedFork on the right.

Attributes

Implicits

Implicits

implicit def heldForkReadiness: Positive[HeldFork]

Ability of HeldFork to

Ability of HeldFork to

  • signal readiness (when picked up or done being used).
  • defer readiness by awaiting a Done signal.

Attributes