First 3 solutions of Dining philosophers

•
A no-holding solution where each philosopher picks up the right fork
ﬁrst and then checks to see if the left fork is available; if not, the
philosopher puts down the right fork and sleeps for a random amount of
time (let’s say ≤ 1 sec) before trying again.
•
The napkin/footman solution where a counting semaphore initialized to
N–1 limits the number of philosophers who can try to eat at the same
time.
•
The even/odd solution where even-numbered philosophers are righthanded
(i.e., pick up their right and then left forks) and odd-numbered
philosophers are left-handed.