Forums Register Login

Thread vs Executor

+Pie Number of slices to send: Send
What is the advantage of using Executors over conventional threading? Can anyone explain with a simple example?
+Pie Number of slices to send: Send
Find a copy of Java Concurrency in Practice by Brian Goetz, Tim Peierls, Joseph Bowbeer, David Holmes, Joshua Bloch, Doug Lea.

I think this thread would sit better in the threads forum, so I shall move it.
+Pie Number of slices to send: Send
Executors is a threadpool.
Its costly to create a new thread everytime to process a task.
Its effective and recommended to reuse threads if possible.
Executors do just that for you.

This is the basic benefit of using Executors over thread creation per task.

For detailed discussions do read the book that Campbell has pointed out!
It would give a normal human mental abilities to rival mine. To think it is just a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 5473 times.
Similar Threads
Thread and Web Applications
Process the multiple records in a file by Producer/consumer concept using Multithreading
Executors
Multi threaded programs in Java
Parallel processing
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 10:23:48.