Too Long; Didn't Read
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.