开发者

In order execution and multitasking

开发者 https://www.devze.com 2023-04-02 02:56 出处:网络
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 u

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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号