Java ExecutorService with a pool of threads for executing mutiple tasks example

preview_player
Показать описание
The real power of ExecutorService comes when we create a pool of threads and execute multiple tasks concurrently in the thread pool.In this example we'll see how you can create an executor service that uses a thread pool and execute multiple tasks concurrently -
Below is the GitHub link to download source:
Рекомендации по теме
Комментарии
Автор

i have 16k records(csv file) all needs to be processed and need to call a rest service API and get the response for each record for that planning to use multithreading executors to process all the records concept pls help me to implement

ranjithabb
Автор

How can I return some data from task1 or task2 ?

joelmartis
Автор

Good example and perfect explanation. Really great!

manimarankrishnamoorthy
Автор

Hi, i have single task which should be shared by multiple pool of threads. i am able to do that but the result is one time shows in thread 1 pool1 sometime thread 2 pool1. how to solve this issue.

santoshvaraghanti
Автор

Hii...
I have 3 queried need to run asyn....and need to wait for the results to store in list....
Then after 3 tasks done...
I need to proceed further running the remaining code....
In this scenario...could anyone suggest which is better to use...

I tried executor service...but it is going sync...not waiting for the threads to complete....
Thanks in advance

vamsi
Автор

Can we use that in swing? Is that more efficient in SwingWorker class?

mr.RAND
Автор

Thanks Kishan. Your explain is really the best. Wish you the best and keep up.

abdollahsobhy
Автор

Hi, why do u have to print the thread name and "my task<n> started" in separate lines?? this will not indicate which thread runs which task.

banganappallimanohar
Автор

please maintain proper playlist of videos sequentially we are facing problem while learning..

mohitsolanki
Автор

How runnable is a marker interface? U said it's a marker interface. Marker interface means that it doesn't contain any method. But runnable has run method

kapiljain
Автор

HI! I need to manage somemthing from the JFrame, can i execute the tasks from another class?

MARQUITOSGUALACBA
Автор

Sir can you have practical application such as very long mathematical calculation or database loading with hundred thousands of row? Thank you and good day.

mr.RAND
Автор

How to use local variable of main method in runnable anonymous class?
Btw Good tutorial.

mr.anonymous
visit shbcf.ru