Java Executor

Executor framework and its usage

Reading Time: 4 minutes The Executor Framework contains a bunch of components that are use to efficiently manage worker threads. The Executor API de-couples the execution of the task from the actual task to execute via Executors. This design is one of the implementations of the Producer-Consumer pattern Executors provide factory methods that is use to create ThreadPools of worker threads. To use the Executor Framework we need to Continue Reading

Scala Future Under The Hood

Reading Time: 3 minutes In the previous post, i was discussing about Scala ExecutionContext. As we know, for multithreading we need to maintain thread pools using ExecutionContext and by default ForkJoinPool is used because for accessing “multi core” processor. There are multiple thread pools are available in our java.util.concurrent.Executors utility class and as per our requirement we can create new one also. After all, Scala have concept of Future. Continue Reading

Java Executor Vs Scala ExecutionContext

Reading Time: 3 minutes Java supports low-level of concurrency and some of rich api’s which is just a wrapper of low-level constructs like wait, notify, synchronize etc, But with Java concurrent packages Scala have high level concurrency frameworks for “which goal to achieve, rather than how to achieve“. These types of programming paradigms are “Asynchronous programming using Futures“, “Reactive programming using event streams“, “Actor based programming” and more. Note: Continue Reading