I've never had to multithread before, I understand what it is at a basic level. I'm wondering what would be the simplest and most efficent way to execute three methods at once?
e.g
public void test(){
method1();
method2();
method3();
}
Basically I want to execute 1,2 and 3 at the same time. I'm looking for any examples or resources which would be useful for doing this.
Thanks!
If your three methods do not share state, you can just spin up a thread for each method.
http://java.sun.com/docs/books/tutorial/essential/concurrency/runthread.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With