Concurrency. What is it?. What is concurrency?. Concurrency is not a new idea… Concurrency was first developed by the ancient Babylonians. They thought about stuff, walked, and chewed gum … all at the same time.
What is it?
More generally …
There are 3 important motivations for concurrency…
Why do we need it?
Race Conditions, Deadlocks, Synchronization and More!
What happens when two room mates run their milk code at the same time?
In this approach, the program simply ignores deadlocks altogether on the assumption they will never happen, or happen rarely.
This is an application of the Ostrich algorithm.
This approach is used when the amount of time between occurrences of deadlocks is large, and the repercussions of the deadlocks are within tolerable limits.
The Dining Philosophers problem involves 5 philosophers with a plate of spaghetti and a fork placed between each pair of adjacent philosophers. A philosopher alternates between thinking and eating, however, a philosopher may not eat unless he has both forks to his sides.
After a philosopher has acquired both forks, he eats for a period of time, sets down the right fork, sets down the left fork and then continues thinking. After this he repeats the process.
The problem …
Comes when each philosopher is waiting on the one to his right to release the 2nd fork. At this point each philosopher will be waiting in a state of deadlock indefinitely.
I wonder what it could be ….
Because everyone needs some a-synchronicity in their life.