Using Java Executor framework for Multithreading [A How To Guide]by@adityasridhar
454 reads

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

tldt arrow
Read on Terminal Reader
Read this story w/o Javascript

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.

Company Mentioned

Mention Thumbnail
featured image - Using Java Executor framework for Multithreading [A How To Guide]
Aditya Sridhar HackerNoon profile picture

@adityasridhar

Aditya Sridhar


Receive Stories from @adityasridhar

react to story with heart

RELATED STORIES

L O A D I N G
. . . comments & more!
Hackernoon hq - po box 2206, edwards, colorado 81632, usa