Author: ZmnSCPxj 2020-05-21 15:36:02
Published on: 2020-05-21T15:36:02+00:00
The issue with Cheney's semispace collector is that it requires twice as much memory during collection. However, the algorithm does not require tospace to be in core memory. Instead, tospace objects could be written into a disk file. This technique may make the technique more palatable for lower-power devices with slightly larger free disk space compared to memory space. It is suggested that qsort, in its in-place array-sorting form, is considered faster than mergesort because of the reduction in cache pressure of in-place sorting due to touching smaller amounts of memory. The reason why qsort can be an in-place sort with only constant amount of extra space needed to run it is because the elements of an array are equal size, and two entries of an array can always be swapped in constant space.Cheney's semispace is a semispace collector because objects could be different sizes. However, using linked lists, we can make all the objects a constant fixed size, making it far amenable to organize them into large arrays of objects. By swapping nodes around, we can make Cheney an in-space algorithm rather than a semispace one, by using similar swap operations. Routing queries are read-only and thus cannot possibly violate the tri-color invariant, thus we can simply pause the Cheney algorithm after advancing the scan pointer in order for the thread to service routing queries, gossip updates, or channel closes. We can manage channel objects using a freelist instead of a GC, only use GC for the nodes themselves. Finally, even once the Cheney algorithm ends (scan == alloc), the nodes beyond the scan/alloc pointer are definitely unreachable from this node. We can mark this point, and routefinding queries for nodes beyond this border can just fail immediately with no route.
Updated on: 2023-06-03T01:39:16.115547+00:00