top of page
Girl with Tablet

in order execution v/s out of order execution

Instructions are processed in a processor using two different methods: out-of-order execution or in-order execution. Let us examine each one in turn:

In-order Execution:

Instructions are processed and carried out strictly in the order they occur in the program when in-order execution is used. Each instruction is fetched, decoded, and executed by the processor in a sequential manner according to the program's control flow. According to this method, each instruction is finished before going on to the next.

The benefits of in-order execution are:

Simplicity: Because in-order execution follows a precise sequential order, it is relatively easier to implement in hardware.
Determinism: By ensuring that the outcomes are delivered in the same order as in the program, the execution order ensures determinism and makes it simpler to analyze and debug the code.


Out-of-Order Execution: In out-of-order execution, the processor uses sophisticated methods to carry out instructions out of order and out of succession. It enables the CPU to locate and carry out concurrently independent instructions, potentially improving performance. To maximize resource use and boost instruction-level parallelism, the CPU dynamically reorders the instructions.

​

Benefits of out of Order:

Out-of-order execution enables the processor to take use of parallelism by carrying out separate instructions concurrently, potentially improving performance.
Resource usage: By lowering idle time and bridging execution gaps with other independent instructions, it allows for improved usage of processor resources.
However, out-of-order execution adds to the processor's design's complexity.
It is important to note that most contemporary processors combine in-order and out-of-order execution strategies in an effort to balance simplicity and efficiency. While maintaining the sequential program order for instructions that have dependencies, the processor dynamically evaluates the instruction flow to determine which instructions can be executed out of order.

 

To understand the details about what are the drawbacks of out of order execution and how modern processors overcome them,  check out next tutorial. 
 

​

bottom of page