in general , in one aspect , the disclosure describes a computer program to access a set of source instructions and identify a variable within the source instructions to be accessed by different threads . the program determines a location within the execution flow specified by the set of source instructions , where the variable value , after the determined flow location , has an unchanging value . the program generates at least one set of target instructions for the source instructions . the target instructions copy the value of the variable from a first memory to a second memory based on the determined location . the generated target instructions access the copy of the value in the second memory for at least one source instruction that specifies access to at least one variable .