executorservice - What is the advantage of Executors over Threads in multithreaded application -


I have seen many comments that executors are better than threads, but if you have many threads that communicate via bound Do buffers (in the form of flow-based programming) whenever you want to use threads in any way, why would you use executors (with new catch Threadpool (?)) Also, I have isAlive () Using methods like, interrupt () - How do I get the thread handle?

Does anyone have sample code that I can write? ; ->

Executives are basically an abstract on thread, they allow you to differentiate your potential parallel argument Runs in a runnable / callable instance, which allows you to manually start a thread or free from the duties of building or managing a pool. You still have to handle the dependency as part of your application logic.

If you want to feel comfortable / intuitively with threads for your application logic, you can skip using executors. Regarding holding the thread, you can always execute the thread. Credaththread () to capture the current thread from an executed reference.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -