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?
In reply to chopsticks5; by jettero
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |