Patent ID: 8020155
Filing Date: 2011-09-13
Classification: G06F

Abstract:
1. A machine implemented method, comprising: causing, by a run time optimizer (RTO) thread executing a RTO at run time, by causing a branch instruction to reference a first version of a function, intercepting, by the RTO thread at run time, a request from the program to create another program thread of execution for executing the executable code; detecting, in response to intercepting the request to create another program thread and based on a thread count of a number of program threads, that the executable code transitioned from only the one program thread to having multiple program threads of execution that invokes the function; and in response to detecting that the executable code has multiple threads of execution that invoke the function, rewriting, by the RTO thread, the branch instruction to reference a second version of the function instead of the first version of the function, wherein the second version of the function is a multi threaded version that does ensure multi thread safety.