8 ms·
As somebody working on embedded software for aerospace, I'm surprised this missile system even had dynamic memory allocation. My entire organization keeps fligh
by jakeinspace 7y ago
As somebody working on embedded software for aerospace, I'm surprised this missile system even had dynamic memory allocation. My entire organization keeps flight-critical code fully statically allocated.
- bootloop 7y agoI would imagine it might make sense if you offload some short, less frequent but memory intensive sub-routines (sensors, navigation) to run in parallel to the rest of the system. But I would still avoid having a system wide dynamic memory management and just implement one specifically for that part.
- Dylan16807 7y agoWhichever ones you allow to run in parallel need to have enough memory to run at the same time, but such a situation might happen quite rarely. In other words, that sounds like a system where dynamic memory management is significantly riskier and harder to test than usual! Why not static allocation, but sharing memory between the greedy chunks of code that can't run parallel to each other? (I assume these chunks exist, because otherwise your worst-case analysis for dynamic memory would be exactly the same as for static, and it wouldn't save you anything.)
- bootloop 7y ago> Why not static allocation, but sharing memory between the greedy chunks of code that can't run parallel to each other? That's what I wanted to say with my comment actually.
- bdavis__ 7y agowhen you design the system, you make sure there is enough physical RAM to do the job. Period. the problem space is bounded.
- giu 7y agoI'm always fascinated about software running on hardware-restricted systems like planes, space shuttles, and so on. Where can someone (i.e., in my case a software engineer who's working with Kotlin but has used C++ in his past) read more about modern approaches to writing embedded software for such systems? I'm asking for one because I'm curious by nature and additionally because I simply take the garbage collector for granted nowadays. Thanks in advance for any pointers (no pun intended)!
- saagarjha 7y agoSearching for things like "MISRA C" and "real-time computing" will help you get started.
- jakeinspace 7y agoMy older co-workers have some great alternative definitions of that initialism.
- giu 7y agoThanks a lot for the keywords; these are very good starting points to look for further stuff on the topic! Didn't know that there was a term (i.e., real-time computing) for this kind of systems / constraints.
- monocasa 7y agoI'd also look a the Joint Strike Fighter C++ Coding Standard. Stroustrup himself hosts it as an example of how C++ is a multi paradigm language that you can use a subset of to meet your engineering needs. http://www.stroustrup.com/JSF-AV-rules.pdf http://www.stroustrup.com/JSF-AV-rules.pdf
- 0xffff2 7y agoThe embedded world is very slow to change, so you can read about "modern approaches" (i.e. approaches used today) in any book about embedded programming written in the last 30 years. I currently work on spacecraft flight software and the only real advance on this project over something like the space shuttle that I can point to is that we're trying out some continuous integration on this project. We would like to use a lot of modern C++ features, but the compiler for our flight hardware platform is GCC 4.1 (upgrading to GCC 4.3 soon if we're lucky).
- 2OEH8eoCRo0 7y agoThis right here. My previous job was in defense and although it was not an embedded project all the software architects on the project were embedded guys used to doing things their way. Dynamic allocation was strictly forbidden.
- dahart 7y agoNote the story isn’t detailed enough to know whether they were using what we’d normally call dynamic memory allocation. The embedded system might not have had a memory manager. Or they might have been, like you, fully statically allocating the memory. Kent could be noting that they’ll run off the end of their statically allocated memory, or run out of address space, because the code isn’t checking the bounds and may be doing something like appending history or sensor data to an array. I have no idea obviously, just imagining multiple ways Kent’s very brief description could be interpreted, it maybe shouldn’t be assumed that the engineering was doing something stupid or even very different from what we’d do today.
- onceUponADime 7y agoDO 187A ?
- p_l 7y agoDO-178C, actually, but good pointer.