Five philosophers sit down to eat rice. There's only 5 chopsticks, so ... really, at most 2 philosophers can eat at a time.
In the C book, we make a typedef to an int * called a semaphore. Then we fork 5 kids. This way we can keep track of which philosophers have chopsticks and when they intend to put one down.
How could we do the semaphore in perl?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: chopsticks5;
by Shendal (Hermit) on Sep 26, 2000 at 22:02 UTC | |
|
Re: chopsticks5;
by BigJoe (Curate) on Sep 26, 2000 at 22:18 UTC | |
|
Re: chopsticks5;
by Adam (Vicar) on Sep 26, 2000 at 22:04 UTC |