 
 
 
 
 
 
   
 of a variable
 of a variable  be the set of 
statements that are involved, directly or indirectly,   
in generating the value of
 be the set of 
statements that are involved, directly or indirectly,   
in generating the value of  in a procedure. 
We use a simple and conservative approach as 
follows to compute
 in a procedure. 
We use a simple and conservative approach as 
follows to compute 
 :
:
 , 
i.e., those that define
, 
i.e., those that define  , are
included in
, are
included in 
 .
.
 that contains all the variables
used in the statements in
 that contains all the variables
used in the statements in 
 .  
Then for each variable
.  
Then for each variable  , 
include
, 
include 
 into
 into 
 .
.
Note that in a block structured language like
C, special care should be taken to restrict 
the computation of 
 in Step 1
within the scope of the declaration of the variable
 in Step 1
within the scope of the declaration of the variable  . 
For example in the code fragment below, lines 4 and 5 should
 not be included in
. 
For example in the code fragment below, lines 4 and 5 should
 not be included in  of the variable
 of the variable  on
line 7.
 on
line 7.
1. void main(void){
2.      int i;
3.      i = 5;
4.      {   int i;
5.          i = 6;
6.      }
7.      lseek(fp,i,SEEK_SET);
8. }
The above algorithm for computing 
 is conservative
and simple to implement. However, it might 
include some redundant definitions of a variable
which never reaches any disk I/O statement.
Since the generated source code will
go through a final compilation phase, we expect
that the compiler could eliminate these redundant
statements with a more detailed data flow 
analysis [1].
 is conservative
and simple to implement. However, it might 
include some redundant definitions of a variable
which never reaches any disk I/O statement.
Since the generated source code will
go through a final compilation phase, we expect
that the compiler could eliminate these redundant
statements with a more detailed data flow 
analysis [1]. 
Given this algorithm to identify related set, we use the following algorithm to analyze a procedure and deduce the corresponding prefetch thread:
 , the set of statements that are I/O related. 
For each variable
, the set of statements that are I/O related. 
For each variable  that appears in the disk access statements,
mark it as I/O related, compute
 that appears in the disk access statements,
mark it as I/O related, compute 
 , and include the result into
, and include the result into  .
. 
 inside its body, mark all the variables
used in the boolean expression of the flow-control 
statement as I/O related. 
For each such variable
 
inside its body, mark all the variables
used in the boolean expression of the flow-control 
statement as I/O related. 
For each such variable  , 
compute
, 
compute 
 , and include it in
, and include it in  .
Repeat this step until
.
Repeat this step until  stops growing in terms of program size.
 stops growing in terms of program size.
 the declaration statements of all variables
that are marked as I/O related.
 the declaration statements of all variables
that are marked as I/O related.
 the necessary synchronization
calls, add send_XXX and receive_XXX calls to
transfer data between the threads, and rename 
shared global variables to avoid simultaneous updates
from both threads.
 the necessary synchronization
calls, add send_XXX and receive_XXX calls to
transfer data between the threads, and rename 
shared global variables to avoid simultaneous updates
from both threads.    
 .
.
The above algorithm executes on each procedure iteratively until the resulting I/O-related variable set converges.
 
 
 
 
