Efficient locking for thread-safe self-modifying code
AssigneeInternational Business Machines Corporation
InventorsKevin A. Stoodley, Andrew Low
Life of this patent
Estimating the term…
Loading patent…
AssigneeInternational Business Machines Corporation
InventorsKevin A. Stoodley, Andrew Low
Estimating the term…
A locking mechanism for use in a multi-thread environment supporting self-modifying code in which modifications to the code are made at runtime. The locking mechanism having associated helper code accessed by a call from the first instruction address in the code block. The helper code calculating the binary encoding for the call instruction and using an atomic compare and exchange instruction to compare the calculated binary encoding with the actual contents of the first instruction address. Where there is a match, a self loop instruction is written to the first instruction address to lock the specified code block for subsequent threads. The helper code contains instructions to resolve the references in the specified block. The last such instruction is an atomic store operation to replace the self loop instruction at the first instruction address with the appropriate modified instruction.
A computer program product comprising a computer usable medium tangibly embodying computer readable program code for defining code to provide a locking mechanism for self-modifying code in a multi-thread environment, the self-modifying code comprising helper code callable to modify instructions in a defined block of the self-modifying code, said computer program product comprising:
A computer program product comprising a computer usable medium tangibly embodying computer readable program code means for defining code to provide a locking mechanism for self-modifying code in a multi-thread environment, the self-modifying code comprising helper code callable to resolve unresolved references in a defined block of the self-modifying code, the helper code loaded at a non-boundary position in memory, said computer program product comprising:
A method for locking self-modifying code in a multi-thread environment, the self-modifying code comprising helper code callable to modify instructions in a defined block of the self-modifying code, the method comprising:
A locking mechanism for self-modifying code in a multi-thread computer system, the self-modifying code comprising helper code callable to modify instructions in a defined block of the self-modifying code, the locking mechanism comprising:
A method for generating executable computer code to define a locking mechanism for runtime resolution of unresolved references in a specified block of executable code in a multithread environment, the method comprising:
Dependencies are inferred from the claim text.