From: Eliot M. <mo...@cs...> - 2007-12-17 01:13:09
|
>>>>> "Athul" == Athul Acharya <aac...@gm...> writes: Athul> Where do mutator threads get suspended for GC? Ah, now that you ask a specific question about suspending, I think you can get a more specific answer. IIRC, the collector sets a flag, that each mutator will eventually check, either if it uses up a block of memory or if it has a quantum expire. The mutator then sets a flag to let the collector know it is suspending, and awaits a gc-is-done notice. That is, it is all done with flags used to signal back and forth. Threads yield willingly, at normal "polling" points. I don't believe we assume there are forced inter-processor interrupts or anything. This is in part because we suspend threads only as GC-safe points. Even quantum expiration thread switches are done by setting a flag and allowing the thread to reach a GC safe point. By design, setting the flag will eventually cause the thread to suspend, but it's a sublte design, not a direct interrupt or something. There are other approaches that other VMs have taken, but (again, IIRC), this is what Jikes RVM does. I am sure Steve B, etc., can confirm/correct this, and point to specific code. So ... maybe if you tell us _why_ you want to suspend a thread (or is it all threads?) we can give more specific advice .... Best wishes -- Eliot Moss |