
...
- 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="91d8002e3cfb3c86-5047dc96-46fa446a-96f1ac9f-d3f4b40920cb144a80176525"><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="5fa0ed60dad32e25-85210802-4aa24fe0-885094e3-123e71c122fce4d4fd5c4973"><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="c7bd41bade26540c-8041ce0b-44fe41af-8f3cade8-93925520b004dcb37db499db"><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="ca8f5d193199ba77-f14dc194-41af444a-a47985de-a0b347fb17def2584b2bc3f2"><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> |
...