Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>On the java.util.concurrent package <a href="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/package-summary.html#MemoryVisibility" rel="nofollow noreferrer">Memory Consistency Properties</a>, you can check the Javadoc API for the package:</p> <blockquote> <p>The methods of all classes in java.util.concurrent and its subpackages extend these guarantees to higher-level synchronization. In particular: </p> <ul> <li>Actions in a thread prior to placing an object into any concurrent collection <em>happen-before</em> actions subsequent to the access or removal of that element from the collection in another thread.<br> [...]</li> <li>Actions prior to "releasing" synchronizer methods such as<br> Lock.unlock, Semaphore.release, and<br> CountDownLatch.countDown<br> <em>happen-before</em> actions subsequent to a successful "acquiring" method such as Lock.lock, Semaphore.acquire, Condition.await, and CountDownLatch.await on the same synchronizer object in another thread.<br> [...]</li> </ul> </blockquote> <p>So, the classes in this package make sure of the concurrency, making use of a set of classes for thread control (<a href="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/locks/Lock.html" rel="nofollow noreferrer"><code>Lock</code></a>, <a href="http://download.oracle.com/javase/6/docs/api/java/util/concurrent/Semaphore.html" rel="nofollow noreferrer"><code>Semaphore</code></a>, etc.). This classes handle the <em>happen-before</em> logic programmatically, i.e. managing a FIFO stack of concurrent threads, locking and releasing current and subsequent threads (i.e. using <code>Thread.wait()</code> and <code>Thread.resume()</code>, etc.</p> <p>Then, (theoretically) you don't need to synchronize your statements accessing this classes, because they are controlling concurrent threads access programmatically.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload