Kamis, 09 Februari 2017

Why do we need Synchronization in real life Applications

When two or more threads are accessing the same resource like a variable or a data structure, it may lead to inconsistent data or value. Such conditions that lead to inconsistency are known as race condition.   As an example let’s consider a variable count whose value is 7 at present. Consider two operations: count = count + 1 which is executed by thread1 and another operation count = count – 1 which is executed by thread2. Note that both threads are sharing the common variables count.   If both threads execute in parallel then the sequence of operation can be either: count = count +

The post Why do we need Synchronization in real life Applications appeared first on Coding Security.


Why do we need Synchronization in real life Applications
read more

Tidak ada komentar:

Posting Komentar