condition variable : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

condition variable
According to Achim Gratz monitors are insufficient if a thread needs to wait inside a monitor until a condition is met: this thread is inside the monitor and so no other thread can enter and change the condition - a deadlock is the result. Condition variables are used to block a thread inside a monitor (wait()) and allow another thread to enter the monitor. When the condition that has led to the blocking changes this is signalled to blocked threads. Java allows distinction between deblocking a single thread (notify()) and unblocking all threads waiting on the CV (Condition Variable) (notifyAll()). This feature is of dubious value if not accompanied by additional program logic (you don’t have control over which thread of the wait set gets its turn) and beginners are probably best off using notifyAll() only.

This page is posted
on the web at:

http://mindprod.com/jgloss/conditionvariable.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\conditionvariable.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[3.16.29.209]
You are visitor number