- Lock: Lock implementations provide more extensive locking operations than can be obtained using synchronized methods and statements. The standard lock implementation may be used anywhere there is a need to restrict access to a shared resource so that only one thread of execution may access the resource. Spceifically,
- When acquiring and releasing a lock may happen in different lexical scopes.
- Chain locking: you acquire the lock of node A, then node B, then release A and acquire C, then release B and acquire D and so on ...
- Read/Write Lock: maintains a pair of associated locks, one for read-only operations and one for writing. The read lock may be held simultaneously by multiple reader threads, so long as there are no writers. The write lock is exclusive.Usage Scenarios:
- In scenarios where where is high frequency of reads and the duration of each is sufficiently long. User registries have such a data access pattern.
Wednesday, November 22, 2006
Java 5 Concurrency: Selecting Locks
As with synchronizers, there is a choice of a few implementations of Locks in Java 5. In the previous post (selecting synchronizers), I gathered a few usage scenarios where the different synchronizers may be used. In this post, I will put together a few usage scenarios where the different Lock implementations may be used.
Labels:
concurrency,
tips
Subscribe to:
Post Comments (Atom)
Popular Posts
-
The previous post described how to implement a JMS messaging client using Spring JMS . This post will describe how to implement the Message ...
-
In this post we will see how to do an offline install Jenkins and required plugins on a Red Hat Enterprise Linux Server release 7.3. This is...
-
JUnit 4 introduces a completely different API to the older versions. JUnit 4 uses Java 5 annotations to describe tests instead of using in...
-
In a previous post, I described how to use Quartz scheduler for scheduling . In this post, I describe the configuration changes required for...
-
In the previous post, I described different ways in which spring and hibernate can be integrated. In this post I will describe how to use Sp...
-
In a previous post, I described how to implement Messaging in Java EE 5 using annotation. This post is an extension of that post to describ...
-
JFreeChart is a free Java chart library that can be used to display charts from Java applications. It features: A wide range of chart types ...
-
Sun Microsystems, Inc. announced the availability of Java Platform Standard Edition 6 ( Java SE 6 ) today. In less than 2yrs of the release ...
-
New posts with iText 5.5.12 Following are two new posts for PDF Merge with iText 5.5.12 Merge PDF files using iText 5 Merge and Paginate PDF...
-
IBM has announced the release of the Rational software delivery platform version 7.0. The platform includes the following products: Rationa...
No comments:
Post a Comment