Changes

Jump to: navigation, search

GPU621/Go Kimchi

44 bytes added, 23:19, 3 August 2021
no edit summary
Java version 5.0 and later provides concurrency to simplify thread creation and processing. The "[https://docs.oracle.com/javase/tutorial/essential/concurrency/executors.html Executor]" that implement by java.util.concurrent provides APIs for creating and processing new threads using reusable threads.
===Implementationfor Go===
----
'''Installation of Go''' <br>
Go to [https://golang.org/dl/ https://golang.org/dl/] & Download Go accordingly to your OS.
'''Installation of Java''' <br>Go to [https://www.java.com/ko/download/manual.jsp https://www.java.com/ko/download/manual.jsp] & Download Java accordingly to your OS.
'''Multi-Thread Program in Go'''
runtime.GC()
}
''' .sh Code to Run Go Program '''
#! /bin/sh
COUNTER=0
MAX=7
go build MatrixMultiGo.go > result.txt
echo "Running tests for no multithreading..."
echo "### No Multithreading" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 0 >> result.txt
done
COUNTER=0
echo "Running tests for 1 thread..."
echo "### Threading with 1 thread" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 1 >> result.txt
done
COUNTER=0
echo "Running tests for 2 threads..."
echo "### Multithreading with 2 threads" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.i 0>> result.txt
done
COUNTER=0
echo "Running tests for 4 threads..."
echo "### Multithreading with 4 threads" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 4 >> result.txt
done
COUNTER=0
echo "Running tests for 8 threads..."
echo "### Multithreading with 8 threads" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 8 >> result.txt
done
COUNTER=0
echo "Running tests for 16 threads..."
echo "### Multithreading with 16 threads" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 16 >> result.txt
done
echo "Done";
 
===Implementation for Java===
----
'''Installation of Java''' <br>
Go to [https://www.java.com/ko/download/manual.jsp https://www.java.com/ko/download/manual.jsp] & Download Java accordingly to your OS.
'''Multi-Thread Program in Java'''
}
''' .sh Code to Run Go Program '''
#! /bin/sh
COUNTER=0
MAX=7
go build MatrixMultiGo.go > result.txt
echo "Running tests for no multithreading..."
echo "### No Multithreading" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 0 >> result.txt
done
COUNTER=0
echo "Running tests for 1 thread..."
echo "### Threading with 1 thread" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 1 >> result.txt
done
COUNTER=0
echo "Running tests for 2 threads..."
echo "### Multithreading with 2 threads" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.i 0>> result.txt
done
COUNTER=0
echo "Running tests for 4 threads..."
echo "### Multithreading with 4 threads" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 4 >> result.txt
done
COUNTER=0
echo "Running tests for 8 threads..."
echo "### Multithreading with 8 threads" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 8 >> result.txt
done
COUNTER=0
echo "Running tests for 16 threads..."
echo "### Multithreading with 16 threads" >> result.txt
while [ $COUNTER -lt $MAX ]
do
((COUNTER++))
echo "Running test #$COUNTER"
nice -n -20 ./MatrixMultiGo 4096.in 16 >> result.txt
done
echo "Done";
''' .sh Code to Run Java Program '''
84
edits

Navigation menu