Posts

Showing posts from January, 2021

Java 9 Parallelism

Image
A current computer programming paradigm is not object-oriented anymore; it is about parallelism 1 . In the programming perspective, concurrency is the composition of independently executing processes. Parallelism is the simultaneous execution of computations. Concurrency is about dealing with lots of things at once. Parallelism is about doing lots of things at once. Concurrency is about structure , parallelism is about execution . Introduction Executor CompletableFuture Fig.1: Threading vs parallel tasking Java Futures are the way to support asynchronous operations. The Java fork/join framework and parallel streams divide a task into multiple subtasks and perform those subtasks parallelly on different cores in a single machine. This will avoid blocking a thread and wasting CPU resources. Introduction The key goal of parallelism is to efficiently partition tasks into sub-tasks(fork) and combine results(join). That will improve the performance in the way