4 ms·
Except in some situations you don't have a GC or can't afford one (hard realtime, embedded devices, osdev).
by zaarn 7y ago
Except in some situations you don't have a GC or can't afford one (hard realtime, embedded devices, osdev).
- pjmlp 7y agoHard realtime, I do agree, there you can even afford any kind of memory allocation, everything needs to be statically defined usually. Embedded devices, depends on the use case, PTC, Aicas, MicroEJ, Astrobe have plenty of happy customers. Same applies to OSDEV, Midori did not have any big problems powering a couple of Microsoft systems before the powers to be decided it wasn't going to be a Windows replacement.
- jstimpfle 7y ago> Midori did not have any big problems powering a couple of Microsoft systems. I will believe that when I see the performance under load with my own eyes, and when I can convince myself that the code is not more cumbersome than manual memory management would be.
- pjmlp 7y agoYou are free to belive whatever you wish, meanwhile the world moves on.
- zaarn 7y agoGC in osdev has quite a large number of problems, performance being one of them, the other being that some resources simply can#t be handled cleanly by a language that can't opt out of a GC. You somewhat need the option to atleast manage some memory very very manually. And of course, the GC needs to work without allocating memory (ie, true in-place GC) otherwise you're going to blow of your kneecaps of fairly spectacularly (this goes double when you need to initialize memory management, which can't rely on a memory allocator being present or free memory being available)
- pjmlp 7y agoYet it has been achieved multiple times. The only thing missing is having companies like Apple and Google are doing with their mobile OSes, "my way or nothing". Usually those that have enjoyed GC aware OSes know what they were capable of, and those that never have, think they know how bad they were.
- atilaneves 7y agoThese situations exist and in those, something like Rust is a very good idea. I maintain that these situations are far rarer than most people imagine (and I've had to deal with more than a few).