The consensus when it comes to multithreading and concurrency in Java-land is to isolate the code you want multithreaded as a βtaskβ and send that task to some kind of executor service or thread pool.
I am wondering:
Thanks in advance for any clarity!
Take a look at ExecutorService:
ExecutorService
submit(Callable)
submit(Runnable)
, , ( ).
, , IO, - / : IE, , , , ..
Threads , , Runnable.
Threads
Runnable
, - ( , )?
. , , , , . , . ; "Java Concurrency in Practice" Goetz et al - .