Patent ID: 7039738

Claim:
A method of handling interrupts in a computer system having an operating system and a virtual machine for executing non-native code the non-native code having a corresponding non-native thread and the virtual machine having a machine initiation process, the method comprising: requesting a device handler thread of a device handler interrupt routine to provide a selected device handler thread during the machine initiation process; executing the selected device handler thread to a point determined in accordance with the completion of predetermined device handler interrupt routine tasks to provide a partially executed device handler thread; placing the partially executed device handler thread into a waiting state during the machine initiation process to provide a waiting partially executed device handler thread for awaiting a device handler interrupt request; executing a non-native thread; when an unscheduled device handler interrupt request occurs before execution of the non-native thread is complete ending execution of the non-native thread at the time that the unscheduled device handler interrupt request occurs in response to the occurrence of the unscheduled device handler interrupt request to provide an unscheduled ending of execution of the non-native thread; placing the non-native thread into a waiting state at the time that the unscheduled device handler interrupt request occurs in response to the occurrence of the unscheduled device handler interrupt request; reactivating the waiting partially executed device handler thread at the time that the unscheduled device handler interrupt request occurs in response to the occurrence of the unscheduled device handler interrupt request whereby the reactivating of the selected device handler thread is unscheduled; executing the waiting partially executed device handler thread to perform the device handling routine; terminating the device handler thread when the device handler interrupt routine is complete; and reactivating the non-native thread in response to the completion of the interrupt handler routine.