Patent ID: 6996829

Claim:
A computer-implemented method for making a call out from a multi-threaded virtual machine embedded in a server that is executing in a master native thread; the method comprising the steps of: in response to detecting a call to a routine in the server made in a current virtual-machine thread of said virtual machine, determining whether the current virtual-machine thread is associated with the master native thread, if the current virtual-machine thread is associated with the master native thread, then making the call to the routine in the server; if the current virtual-machine thread is not associated with the master native thread, then making the call to the routine in the server after performing the steps of: associating the current virtual-machine thread with said master native thread; and transferring execution control to said master native thread; wherein the current virtual-machine thread is a non-master virtual-machine thread that is associated with a non-master native thread; wherein the step of transferring execution control is performed by transferring execution control from said non-master native thread to said master native thread; wherein the current virtual-machine thread is associated with the non-master virtual-machine thread by a first pointer; and wherein the step of associating the current virtual-machine thread with the master native thread is performed by causing the first pointer to point to the master native thread.