3 ms·
That's a cool GC algorithm, but it has two big drawbacks: 1. It works well only if the number of GCed data structures -- i.e. the number of entry/exit points -
by pron 11y ago
That's a cool GC algorithm, but it has two big drawbacks:
1. It works well only if the number of GCed data structures -- i.e. the number of entry/exit points -- is relatively small (in this case, just the method cache).
2. It prevents inlining of the data structure's access functions, which adds quite a bit of overhead to each access (though not as much as two fenced CASes).
It can, however, be very useful for hot code swapping (provided there's no inlining or you have a JIT that can un-inline).
- pcwalton 11y agoI think the way to look at this is more of as a synchronization technique as opposed to a general-purpose GC algorithm. I don't understand the objection about inlining--could you explain? You could in principle not use function boundaries to delimit the critical section: a range of PC addresses within a function would do just as well.
- pron 11y ago> a range of PC addresses within a function would do just as well Yes, but you'll need to know where those ranges are (i.e. you'll need some feedback from the compiler), and then be very careful that no tool injects any instructions into, or moves code around your executable/library.