Wednesday, January 20, 2010

Common Concurrency Challenges

1) Race Condition
Multiple threads access the same shared data without the appropriate locks on shared data.When this condition occurs, one thread may inadvertently overwrite data used by another thread, leading to both loss of information and data corruption.Minimun requirement for Race Condition to occur is 2 threads and 1 shared data object amongst them.

2) Thread Block
A thread calls a long-running operation while holding a lock thereby preventing the progress of other threads.When this condition occurs, application performance can drop dramatically due to a single bottleneck for all threads.

3) Deadlock
Two or more threads wait for locks in a circular chain such that the locks can never be acquired. When this condition occurs, the entire software system may halt, as none of the threads can either proceed along their current execution paths or exit. Minimum requirement for deadlock to occur is 2 threads and 2 shared data objects amongst these 2 threads.

No comments:

Post a Comment