|
Understanding Concurrency Control
Inorder to understand concurrency control we should aware that Programs do not run in the multi-user situation as same as
in the consecutive running situation.. This is the general mistake. People try techniques and tests for consecutive
running but always forget to try how it will look like in the multi user situation.
It is same with this anology. Cars arrive orderly and we can predict everything in this condition
Then no problem occurs but this doesn't mean that we did everything correct Asume All the cars
comes at the same instant then waiting queues will be formed and waiting time will increase
exponentially since each car waits some other car.And additional servicing time.
In Cpu staff is like this. Cpu takes thread with respect to its priority and Run it with respect to CPU's time quantum.
Then put it queue back and take new thread, In the switching between thread to thread (Context Switch) you will lost time
and if you are unable to think about the Locking issues than Race condition may occur.
As it is said on the top if Everything occurs consecutively you do not need to think each of this.
But in Real Life nothing occurs as it was in the theory.
|