Divide and Conquer algorithms are great subject for parallelism. Here we present Parallel Merge Sort implemented using Java ForkJoin Framework.
Continue reading Parallel Merge Sort in Javajava-concurrency
java.lang.InterruptedException is thrown when a Thread blocked in Object.wait(), Thread.join(), or Thread.sleep() is interrupted. Here we’ll look at these cases.
Continue reading java.lang.InterruptedExceptionjava.lang.IllegalMonitorStateException form Object’s notify/wait methods indicates basic synchronization issue. In this post we’ll show the reason and how to fix it!
Continue reading Java IllegalMonitorStateExceptionUntil Java 7 there was no simple and effective way to generate random numbers concurrently. Here we show ThreadLocalRandom to generate random numbers in a thread-safe way.
Continue reading Generate random numbers concurrently – ThreadLocalRandomOne way to prevent concurrent modifications from different Threads is to given them their own local data. Java ThreadLocal allows to do thread data separation.
Continue reading Java ThreadLocal – thread data separationIn Java Fork Join Framework takes advantage of multiple processors to process divide and conquer algorithms with full power. In this post we’ll show how to start with Fork Join processing.
Continue reading Java Fork Join exampleJava CyclicBarrier is very convenient synchronization tool for writing concurrent simulations. In this post we’ll show how it works and write a game simulation.
Continue reading Java CyclicBarrier – game simulationProblem: How to use Java ScheduledThreadPoolExecutor to schedule tasks for one-time or repeated execution? In this post we’re going to show newer alternative to Timer/TimerTask pair.
Continue reading Java ScheduledThreadPoolExecutor ExampleProblem: How to use Java Timer and TimerTask to schedule tasks execution at specified time or in repeated manner? In this post we’re going to show cooperation of these two classes.
Continue reading Java Timer/TimerTask exampleProblem: How to use Java CountDownLatch to synchronize one or more tasks? The CountDownLatch is one of the most useful and easy to use classes from java.util.concurrent package. Learn how to use it!
Continue reading Java CountDownLatch example