The book talks about the dinning philosophers problem at page 703-704. The book mentions that deadlock would happen if every philosopher grabbed his left chopstick and hold onto it cause nobody can have his right chopstick.
Here is a quote from page 704:
"If you find yourself at a table with four other people and only five chopsticks between you, simply agree to pick up the left chopstick first and the right chopstick second. When you are ready to stop eating and start thinking, put them down in reverse order. Believe it or not, no deadlock will happen, and no one will starve."
Everybody Picking up the left chopstick is exactly what would cause the deadlock. I don't understand how this would work. If the deadlock already happens, how putting the right chopstick first could help?
Here is a quote from page 704:
"If you find yourself at a table with four other people and only five chopsticks between you, simply agree to pick up the left chopstick first and the right chopstick second. When you are ready to stop eating and start thinking, put them down in reverse order. Believe it or not, no deadlock will happen, and no one will starve."
Everybody Picking up the left chopstick is exactly what would cause the deadlock. I don't understand how this would work. If the deadlock already happens, how putting the right chopstick first could help?