chapter15

package
v0.0.0-...-45e99ae Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 30, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FizzBuzzMultiThread

func FizzBuzzMultiThread(n int)

FizzBuzzMultiThread implements the fizzbuzz algorithm in 3 go-routines

Types

type ChopStick

type ChopStick struct {
	Ctx  context.Context
	Lock *semaphore.Weighted
}

ChopStick is s the chopstick needed for dining

func NewChopStick

func NewChopStick(ctx context.Context) *ChopStick

NewChopStick creates a new chopstick

type Philosopher

type Philosopher struct {
	// contains filtered or unexported fields
}

Philosopher is a person who can eat with a chopstick

func NewPhilosopher

func NewPhilosopher(left, right *ChopStick, name string) *Philosopher

NewPhilosopher creates a new instance of a philosopher

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL