Pages

Wednesday, April 3, 2013

Starving Deadlocks

Starving deadlocks are handled by the mel exceptions, NOOUT for Producers and NOIN for Consumers. These exceptions must be specifically added by the programmers. If the programmers know that starving deadlock cannot occur, it is recommended that the exceptions should not be added since there may be a run-time penalty for checking for the exception conditions.

How long should a wait be for these exceptions to trigger?

Deadlocks

Deadlocks are well-known problems with concurrent programming. There are several types of deadlocks:
  1. Starving deadlocks apply to an execution thread where it does not get the necessary input to move on.
     
  2. Contention deadlocks happen when multiple shared resources are required by different execution threads, but they are distributed among these threads so that no one has all the resources necessary to move on.
     
Let's explore how NERWous C handle deadlocks.