Patent ID: 7831961

Claim:
A method of cooperative preemption for a multiprocessor, comprising: inserting instructions in delay slots of delayed control transfer instructions at call and backward branch safe points in mutator code, stored in at least one computer readable medium, the instructions operable to selectively trigger an exception based on an indication stored in the at least one computer readable medium, the indication operable to be one of a group comprising set by a garbage collector and set for the garbage collector, the selective triggering of the exception invoking a safepoint trap handler to handle the exception, wherein mutator code comprises code that changes a state of heap-allocated storage and does not implement a garbage collection strategy; executing the instructions utilizing at least one thread of at least one multiprocessor; and suspending the at least one thread utilizing the safepoint trap handler, the safepoint trap handler executed by the at least one multiprocessor, when the safepoint trap handler is invoked to handle the exception by the selective triggering of the exception based on the indication.