Re:OBNC Oberon Compiler
by vidarh on Sunday September 02, 2018 @02:09PM
(#17897919)
The main issue with GC for system level use is avoiding GC pauses in latency critical parts of the code. You can achieve that a large number of ways, but one of the simplest is to simply disable the GC in latency critical sections (such as interrupts) and ensure you set aside enough memory to prevent needing a collection to let the critical sections complete.
If you need dynamic allocation in such sections, you can still do so as long as you set safety limits to ensure sufficient memory will be available, or e.g. let the latency critical code allocate from separate parts of the heap or using a different allocation scheme (e.g. pre-allocated arenas).
There are lots of details to get right, but the "common narrative" basically assumes you're not able to disable the collector when you want to and no way of safely pre-empting the collector. But making it possible to selectively disable a GC and ensure your latency critical code can safely do so is fairly straightforward.
If you need dynamic allocation in such sections, you can still do so as long as you set safety limits to ensure sufficient memory will be available, or e.g. let the latency critical code allocate from separate parts of the heap or using a different allocation scheme (e.g. pre-allocated arenas).
There are lots of details to get right, but the "common narrative" basically assumes you're not able to disable the collector when you want to and no way of safely pre-empting the collector. But making it possible to selectively disable a GC and ensure your latency critical code can safely do so is fairly straightforward.