...
- Each thread uses a unique
Condition
object. - Each
Condition
object is associated with a common the sameLock
object.
When used securely, the signal()
method has better performance than signalAll()
.
...
This noncompliant code example violates the liveness property. Each thread has a different condition predicate because each requires step
to have a different value before proceeding. The Object.notify()
method wakes up only one thread at a time. Unless it happens to wake up the thread that is required to perform the next step, the program will deadlock.
...
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="c66abe223391dca4-7fdb155d-4ae34d07-9c13ab39-c144153b8106d8a292c40715"><ac:plain-text-body><![CDATA[ | [[API 2006 | AA. Bibliography#API 06]] | | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="dbe241a4c2eb39eb-567c2ac9-4d7f4961-b0d997b7-1c0513def10dac5ba371dcaf"><ac:plain-text-body><![CDATA[ | [[JLS 2005 | AA. Bibliography#JLS 05]] | [Chapter 17, Threads and Locks | http://java.sun.com/docs/books/jls/third_edition/html/memory.html] | ]]></ac:plain-text-body></ac:structured-macro> |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="3b0142ab0fab5539-cafcc399-469f4525-9068870c-9ee5f3fd86a3c40b3ee55837"><ac:plain-text-body><![CDATA[ | [[Goetz 2006 | AA. Bibliography#Goetz 06]] | Section 14.2.4, Notification | ]]></ac:plain-text-body></ac:structured-macro> | |
<ac:structured-macro ac:name="unmigrated-wiki-markup" ac:schema-version="1" ac:macro-id="00afc392226c3af3-5e85c572-431046f5-a9daa85f-2279c63bbcd6a234dd5d76b4"><ac:plain-text-body><![CDATA[ | [[Bloch 2001 | AA. Bibliography#Bloch 01]] | Item 50. Never invoke wait outside a loop | ]]></ac:plain-text-body></ac:structured-macro> |
...