Hello,
I have an assignment with threads and I cant have the threads go into busy wait state. How do I know if a thread is in blocking state or in busy wait? Is there a command that checks it?
In the program I have 2 matrices and I need to transform them. So I have a transform thread and the code is as follows:
transformThread transformThreadFirst = new transformThread(firstMat, n);
transformThread transformThreadSecond = new transformThread(secondMat, n);
transformThreadFirst.start();
transformThreadSecond.start();
try
{
transformThreadFirst.join();
transformThreadSecond.join();
}
catch(InterruptedException e)
{
}
Any of the threads will be in busy wait or is it ok? Or you have a better solution? Also in the run of the transformThread I do not use any yield, just 2 for loops and thats it, just the transform action..
Thanks in advance,
Greg