def haveDinner(philosopherId):
    leftFork = philosopherId
rightFork = (philosopherId + 1) % FORKS_COUNT
if leftFork > rightFork:
    swap(leftFork, rightFork)
while true:
    pass
Non-blocking solution to the dining philosophers