How Distributed Systems Avoid Race Conditions using Pessimistic Locking?
When two updates to a data source are executed in a single-process system, they are always run one after the other, as the process will only be working on one update at a particular time. However, in a multi-process system, there is a chance that the two updates can be executed at the same time by the processes on the shared data source. This situation is known as a race condition, and it can lead to an undesired data state. Fig. Sequential Updates in Single Process SystemFig. Race Condition in ...
Read more at newsletter.scalablethread.com