Patent ID: 8230409
Filing Date: 2012-07-24
Classification: G06F

Abstract:
1. A computer implemented method for optimization of computer usable program code segment containing multiple reader locks having a non-reader lock therein, the computer implemented method comprising: obtaining computer usable program code that is to be compiled; responsive to obtaining the computer usable code that is to be compiled, identifying, by a compiler, a critical segment within the computer usable program code; replicating the critical segment to create a replicated segment; and transforming the critical segment by establishing a reader lock only version of the critical segment and a writer lock only version of the replicated segment together as a transformed code segment so that a reader lock is used when control flow paths execute without any writes occurring, and when a control flow path executes that will cause a write to occur, then the writer lock only version will be acquired and all of the critical segment will be re-executed under the writer lock only version and any values read while the critical segment was protected under the reader lock only version are deleted.