Thursday 12 July 2012

What is Race Condition

Race Condition in java Thread

whenever we talk about java its incomplete without multithreading and when we use multi thread environment lot of concept comes in mind like concurrency,synchronization,deadlock,race condition ,mutual exclusion etc .this are all buzz words in the environment of thread.
Now the Question is “what is Race Condition “in very simple word in multithread Environment if more than one thread wants to access the shared data at the same time and we have not made proper protection of that shared data will cause a improper and inconsistent result only if all the thread wants to modify the data if they are only reading the data then there is no issue but if threads are writing or changing the value then this situation will called as race condition. We can conclude race condition as
·        are performed by two threads
·        At the same location
·        Not the read operation
·        Its not the synchronized operation

No comments:

Post a Comment