Discussion Locked

Parallelism and Concurrency in java

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
Write a parallel program in java to add the elements of an array of 20 integers.

5 replies

by roland11

// loads an Array in parallel Threads

/**
* @author Roland Schmidt
*/
public class ArrayLoader {
public void load(final int[] array) {
Thread[] threadArr = new Thread[array.length];
// create Threads
for (int i=0; i

This discussion is closed to new replies.