In this article, we will examine the subtleties of using newly introduced Lock classes in java.util.concurrent.locks package and their advantages over traditional "synchronized" blocks and methods.
threads
Java Concurrency Series- How to use Lock/RentrantLock in Java 5
By sharadjava - Posted on May 23rd, 2008
Tagged:
- sharadjava's blog
- 1 comment
- Read more
- 1414 reads
Java Concurrency Series- How to use Future/FutureTask and Callable
By sharadjava - Posted on May 18th, 2008
Tagged:
In this article we will discuss how to use the new interface Callable introduced in java.concurrent.util in Java 5. Callable along with another interface Future allows us to obtain a return value from a method executed in a separate thread.
In the second example we will also examine the usage of FutureTask, an implementation of Future.
- sharadjava's blog
- 5 comments
- Read more
- 4283 reads
Java Concurrency Series - another Executor example
By sharadjava - Posted on April 28th, 2008
Tagged:
In an earlier article on Executor, we looked at how we can create use the executor to create thread pools to manage our multi-threaded program. We shall continue to explore additional features of this class.
Here we will extend the ThreadPooledExecutor class and provide our implementation to replace the empty implementation.
- sharadjava's blog
- 1 comment
- Read more
- 1241 reads