mardi 30 septembre 2014

ThreadPool quitting upon submit


Vote count:

0




As soon as I submit a runnable to the threadExecutor it quits and I can't figure out why. I've traced the code, but to no avail.



ExecutorService threadPool = Executors.newFixedThreadPool(threads); // create thread pool
threadPool.submit(new Multiplier(this.getColumnsOfRow(i), B.getRowsOfColumn(j), C, i, j)); // just quits here

class Multiplier implements Runnable {

Double[] ARow, BCol;
Matrix C;
int insertRow, insertCol;

public Multiplier(Double[] ARow, Double[] BCol, Matrix C, int insertRow, int insertCol) {
System.out.println("We are here!"); // we never get here..
this.ARow = ARow;
this.BCol = BCol;
this.C = C;
this.insertRow = insertRow;
this.insertCol = insertCol;
}

@Override
public void run() {
double sum = 0;
for (int i = 0; i < ARow.length; i++) {
sum += ARow[i]*BCol[i];
}
C.insertValue(insertRow,insertCol,sum);
}
}


Does anyone have any idea why this would be?



asked 32 secs ago







ThreadPool quitting upon submit

Aucun commentaire:

Enregistrer un commentaire