In order execution and multitasking
Is there any relation b/w the order of exec开发者_开发问答ution (in-order & out-of-order) and multitasking? As per my understanding, a processor executing tasks in-order can support multitasking using pre-emption. This is also true for out-of-order processors but the main difference from in-order execution is reduced number of stalls and hence effective CPU utilization. Am I correct on this or is there a relation b/w the order of execution and multitasking?
Thank you.
There is no relation between multitasking and out-of-order execution.
Multitasking is executing multiple programs seemingly in parallel by periodically switching from task to task. This happens at the process level.
Out-of-order execution is the concept of re-ordering CPU instructions in a way that makes them faster to execute. This happens at the CPU instruction level.
to continue with what is said ....
consider this scenario...
char x =read some byte from a memory;
int a = 10+ 20;
print/use char x;
now when this is on the pipeline... the processor will have to wait until data is read from memomry (this is called stalling of the pipeline).. out-of execution allows the processor to go ahead and execute a=10+20 instruction as it is in no way dependent on previously computed answers ... this prevents stalling
精彩评论