Patent ID: 7346762

Claim:
A method of processing an instruction stream comprising instructions associated with two or more processes, the method comprising: receiving an instruction associated with a first process from an instruction queue; determining if the instruction, when executed, causes data to be read from or written to a buffer that is shared by the first process and a second process; forwarding the instruction to an execution unit if the instruction does not cause data to be read from or written to a buffer that is shared by the first process and the second process; when the instruction causes data to be read from or written to a buffer that is shared by the first process and the second process: retrieving a rule associated with the instruction; determining, based on the retrieved rule, if the instruction is to be replaced; if the instruction is not to be replaced, forwarding the instruction to the execution unit; if the instruction is to be replaced, replacing the instruction with one or more replacement instructions, based on the retrieved rule, and replacing other corresponding instructions in the instruction queue with the one or more replacement instructions.