4 ms·
The real point of using C and (less so, but still) C++ is not to have the ultimate performance, but to have ultimate control over the program execution. Garbage
by SomeoneFromCA 6y ago
The real point of using C and (less so, but still) C++ is not to have the ultimate performance, but to have ultimate control over the program execution. Garbage collection and real-time code are not compatible, because GC introduces random, unexpected stalls in the program flow; even simple reference counting can be harmful, if the last reference get eliminated in the wrong time, and creates a cascade of deallocations.
- pjmlp 6y agoThen using C and C++ is a mistake, because there isn't an ultimate control about how memory allocator interacts with the OS. So much that in the 90's there were vendors that could make a business out of selling specialized memory allocators.
- SomeoneFromCA 6y agoReally? What about an OS kernel code? How does "it's allcator" interacts "with the OS"? And what these allocators were written in?
- pjmlp 6y agoUsually in a mix of Assembly and whatever is used in OS systems implementation language, not necessarily C. https://inf.ethz.ch/personal/wirth/ProjectOberon/Sources/Kernel.Mod.txt https://inf.ethz.ch/personal/wirth/ProjectOberon/Sources/Ker... The malloc() exposed in a ISO C standard library implementation isn't necessarily related to whatever means the OS does memory allocation.