Patent ID: 8424013

Claim:
A method of mapping an interrupt to one or more of a plurality of instances, comprising: registering a plurality of instances to run on a current CPU; running a first instance of the plurality of instances on the current CPU; for each of at least two instances of the plurality of instances, being different from the first instance, registering an interrupt service routine thereof that is able to handle an interrupt, wherein each of the at least two instances has a corresponding code context, and wherein, for each of the at least two instances, the interrupt service routine registered therewith, if executed, runs using the corresponding code context of the instance with which the interrupt service routine is registered; receiving the interrupt at the current CPU; in response to receiving the interrupt, storing context information relating to the first instance; identifying one of the at least two instances as a second instance of the plurality of instances, the second instance having the interrupt service routine that is registered to handle the interrupt, wherein the second instance is identified by selecting the second instance from among all instances of the plurality of instances that: (i) have the interrupt service routine that is registered to handle the interrupt, (ii) are registered to run on the current CPU and (iii) are not actively running on another CPU; running the interrupt service routine of the second instance using the corresponding code context of the second instance and using the current CPU; after completing the interrupt service routine, restoring the context information relating to the first instance; registering each of the plurality of instances to run on one of a plurality of CPUs, a subset of the plurality of CPUs, or all of the plurality of CPUs; and delivering the interrupt to a union of all CPUs that any of the plurality of instances comprising the interrupt service routine for that interrupt are registered to run on.