This section contains 413 words (approx. 2 pages at 300 words per page) |
Computer programs are generally written as lists of commands to be executed one by one. Yet consider a program that contains the following two consecutive lines:
- Z = 3.0
- X = Y x 2
Clearly there is no reason why the first command has to be completed before the second; the variable Z could be set equal to 3.0 while the second command is being executed. It can therefore be said that there is no dependency between "Z = 3.0" and "X = Y x 2": neither depends on the other. Now consider the following, slightly different lines of code:
- Y = 3.0
- X = Y x 2
Here, "Y = 3.0" must be completed before "X = Y x 2" can be calculated (otherwise, the Y value used by the second line of code may not be 3.0). A data dependency is said to exist. This particular type of data dependency is called a read-after-write (RAW) dependency because the read of Y in the second...
This section contains 413 words (approx. 2 pages at 300 words per page) |