Page 1 of 1

About Question enthuware.ocpjp.v7.2.1272 :

Posted: Sat Dec 31, 2016 8:34 am
by jagoneye
Complicated example which could have been much simpler. :(

Re: About Question enthuware.ocpjp.v7.2.1272 :

Posted: Wed Jan 11, 2017 2:42 pm
by jagoneye

Code: Select all

int mid = (from+to)/2;
ComplicatedTask newtask1 = new ComplicatedTask(ia, from, mid); ComplicatedTask newtask2 = new ComplicatedTask(ia, mid+1, to); 
invokeAll(newtask1,newtask2);
sum = newtask1.join()+newtask2.join();
This is the code that I studied from CoreJava.
So does this code execute in multi-threads or perform computations locally only?