Search code examples
cmultithreadinghyperthreadingpipelining

how basic instructions run in parallel


Maybe this is a stupid question but I am trying to gain a better understanding of hardware inner workings...

if a cpu has multi threads and we have a group of instruction set to assign it. as i read how it work from http://www.lighterra.com/papers/basicinstructionscheduling/ link. it says compiler will create a dependency tree of instructions and than instructions will run in parallel.how cpu will know dependent instruction has been finished or not. will it increase complexity.

i write a c code to see this

int main()
{
getchar();
putchar('a'); 
return 0;    
}

i think that instructions of getchar() and putchar() are independent and when i am not giving input from keyboard than on other thread instructions of putchar('a') should be executed and it should show output before asking for input. but it wait fist for input all time.

thanks in advance.


Solution

  • That article mentions the CDC 6600, one of the first computers to implement scoreboarding .