- This project refers (Concurrency in Go and Java - Naohiro Togashi, 2014).
- main functions : Generates random number based matrix and allocates these data to threads
- Calculating multiple of matrices simply(Extending Thread)
@Override
public void run(){
for(int i = indexNum; i < indexEnd; i ++)
for(int j = 0; j < matrixC.length; j++)
for(int k = 0; k < matrixC.length; k++)
matrixC[i][j] += matrixA[i][k] * matrixB[k][j];
}- You can find the reason why we have used nanoTime() to get time on StackOverflow.
func multiply(index int, size int, ch chan<- int){
for i:=0; i<size/threadCount; i++{
for j:=0; j<size/threadCount; j++{
var sum int=0
for k:=0; k<size; k++{
sum = sum + MatrixA[index + i][k] * MatrixB[k][index + j]
}
MatrixC[index+i][j] = sum
}
}
ch <- 0
}This is on GitHub.
- EuiJin Ham (Leader)
- Dongmin Jeong
- Seho Chun
- SungSoo Park