Can we use deadlocks?
2 answers
A deadlock is a situation where two or more competing actions are waiting for another, and, does.
So your goal is not to fall into it. If your code is deadlocked, then you need to go back and re-design your code to avoid / minimize such deadlocks. It would also be nice to have some kind of recovery mechanism and warning when you get stuck.
Now for your question: can this be used for something? Well, there is always a good use, because something depends on your situation and your goal. Here are some scenarios:
- If you are a hacker trying to attack an application, you can freeze the system, forcing it into many dead ends.
- If you are the developer of any deadlock detection system, you want to create such deadlocks in a test environment to make sure it gets caught by your system or not.
+2
source to share