OS - Deadlock vs Race Around Condition (Must)
Deadlock :
- This happens when 2 or more threads are waiting on each other to release the resource for infinite amount of time.
- In this the threads are in blocked state and not executing.
Race/Race Condition :
- This happens when 2 or more threads run in parallel but end up giving a result which is wrong and not equivalent if all the operations are done in sequential order.
- Here all the threads run and execute there operations.
In Coding we need to avoid both race and deadlock condition.
No comments