Sunday, 15 June 2014

java - Run multiple threads and stop once one has stopped -



java - Run multiple threads and stop once one has stopped -

i'd start couple of threads seek connect servers.

arraylist<thread> stack = new arraylist<thread>(); stack.add(new thread() { public void run() { // // success // thread finished } }); stack.add(new thread() { public void run() { // // success // thread finished } }); (int i=0; i<stack.size(); i++) { stack.get(i).start(); }

i'd kill other thread when 1 has finished. how can ? android app.

thanks.

the executorcompletionservice has illustration in javadoc.

java android multithreading

No comments:

Post a Comment