|
@@ -44,7 +44,6 @@ public class BaseArrayParalell {
|
|
|
int x = 0;
|
|
int x = 0;
|
|
|
for (int offset = begin, bound=end-blocksize; offset < bound; offset += blocksize) {
|
|
for (int offset = begin, bound=end-blocksize; offset < bound; offset += blocksize) {
|
|
|
int let_offset = offset;
|
|
int let_offset = offset;
|
|
|
- System.out.printf(">>>>> ARRAY TASK[%d]: %d-%d%n", ++x, let_offset, let_offset + blocksize);
|
|
|
|
|
tasks.add(() -> {
|
|
tasks.add(() -> {
|
|
|
loop(array, begin, let_offset, let_offset + blocksize, consumer);
|
|
loop(array, begin, let_offset, let_offset + blocksize, consumer);
|
|
|
return null;
|
|
return null;
|
|
@@ -53,13 +52,11 @@ public class BaseArrayParalell {
|
|
|
|
|
|
|
|
int tail = length % threads;
|
|
int tail = length % threads;
|
|
|
if (tail != 0) {
|
|
if (tail != 0) {
|
|
|
- System.out.println(">>>>> ARRAY TASK TAIL: " + (tail));
|
|
|
|
|
tasks.add(() -> {
|
|
tasks.add(() -> {
|
|
|
loop(array, begin, end - tail, end, consumer);
|
|
loop(array, begin, end - tail, end, consumer);
|
|
|
return null;
|
|
return null;
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
- System.out.println(">>>>> ARRAY: " + tasks.size());
|
|
|
|
|
ForkJoinPool.commonPool().invokeAll(tasks);
|
|
ForkJoinPool.commonPool().invokeAll(tasks);
|
|
|
}
|
|
}
|
|
|
|
|
|