The consensus, when it comes to multi-threading & concurrency in Java-land, is to isolate the code you want multi-threaded as a "task" and to submit that task to some kind of executor service or thread pool.
What I'm wondering is:
- Can a task be any method of any object, or does it have to be something special (if so, what)?
- How do you determine whether this task is CPU-, IO-bound or other? What are some "dead giveaways" or other deciding factors?
Thanks in advance for any clarity here!