Using Java Executor framework for Multithreading [A How To Guide]

Written by adityasridhar | Published 2019/12/14
Tech Story Tags: java | multithreading | concurrent-programming | concurrency | java-framework | executor-framework-java | hackernoon-top-story | programming-top-story

TLDR In my Previous Blog I covered the basics of Multithreading in Java. The previous Blog covered how to create Threads by Extending the Thread class and implementing the Runnable Interface. This article will be covering 2 topics: Creating Threads using the Callable Interface and using the Executor Framework in Java. Creating a Thread on the Fly everytime is Resource Intensive. This is where the Executors Class and ExecutorService are very useful. We create a fixed Thread pool of size 4. Whenever we want any task to be run, we can assign it to these threads. Once the task is complete, the Thread will be freed to take up other tasks.via the TL;DR App

no story

Written by adityasridhar | I Love Technology and Like Exploring the Tech World
Published by HackerNoon on 2019/12/14