Tag : Locks

Say that you are eating some sweets while watching a movie. You had a look at your pack or sweets, counted five and continued watching the movie. Took the first one and deducted this in your mind (without looking at the sweets pack). In the mean time, and without you knowing, your daughter takes one. While you think that there are four sweets left, in reality there are only three. You will discover this at the end when you are looking for the last one. This is a Race Condition and in this article we will see how this occurs in programming and how we can avoid it.

Albert Attard
Author: 3 years ago

Imagine you are waiting for a call from your girlfriend with whom you had an argument. She too is waiting for you to call her and apologise. In other words, both of you are waiting for the other to call. Now if no one takes the phone and calls the other, you will never talk again. This is a deadlock and in this article we will see how deadlock occurs in programming and how to prevent it.

Albert Attard
Author: 4 years ago