Live data from Hacker News

Fearless concurrency in your microcontroller

blog.japaric.io

21–30 of 52 posts

Re: Fearless concurrency in your microcontroller

#21

Earlier quoted context omitted.

No offense, but nobody in their right mind is going to use any of this in a production environment. For instance, what will your hypersonic rocket do while garbage collection is running instead of it's real-time control loops?

Hypersonic rockets are probably already running Ada.

Good point :) I probably should have stuck to picking on Java. Ada is a pretty good example of a language that handles real time use cases with concurrency and memory pools well. That said, it's fallen out of favor in "recent" years.

Re: Fearless concurrency in your microcontroller

#23

Earlier quoted context omitted.

Hypersonic rockets are probably already running Ada.

Good point :) I probably should have stuck to picking on Java. Ada is a pretty good example of a language that handles real time use cases with concurrency and memory pools well. That said, it's fallen out of favor in "recent" years.

How many examples from military systems using real time Java do you want me to provide?

I can also provide examples for energy motoring, copiers, factory control systems and phone infrastructures.

Re: Fearless concurrency in your microcontroller

#24
post #11

Earlier quoted context omitted.

Yes, some examples, this list is not exhaustive. - Oberon, http://www.astrobe.com/default.htm - Java, http://www.microej.com/resources/supported-platforms/ - Pascal and Basic, https://www.mikroe.com/stm32/ - Ada, http://blog.adacore.com/tag/STM32

No offense, but nobody in their right mind is going to use any of this in a production environment. For instance, what will your hypersonic rocket do while garbage collection is running instead of it's real-time control loops?

I guess the French and US military using Aonix real time JVMs for weapons control and monitoring are the right set of persons to answer your question.

Also some military think memory leaks are irrelevant on missiles, given the ultimate garbage collector.

Re: Fearless concurrency in your microcontroller

#25
post #4

I really hope rust gains a foothold in the embedded market. We need these features badly. As uCs get more powerful (you can get 200mhz chips for a few dollars) with more RAM and complicated networked peripherals, it's a no-brainer to have these features available in a safe way. Currently if you have an application relying on dynamic memory usage, for instance, most developers will write their own simple memory manage…

Otoh controllers cost almost nothing, so you can get safe concurrency just by duplicating the CPU.

On the other hand building a system out of a lot of small processors tends to lead to very complex systems in the end, since the different parts almost always need to communicate at some point. In the end it doesn't buy you much since you end up having to write message passing systems and their associated handlers everywhere.

Re: Fearless concurrency in your microcontroller

#26
post #23

Earlier quoted context omitted.

Good point :) I probably should have stuck to picking on Java. Ada is a pretty good example of a language that handles real time use cases with concurrency and memory pools well. That said, it's fallen out of favor in "recent" years.

How many examples from military systems using real time Java do you want me to provide? I can also provide examples for energy motoring, copiers, factory control systems and phone infrastructures.

I've never heard of "real time Java" before—is it soft real-time, like Erlang; or hard real-time, like QNX? What are the concurrency primitives? (Threads? Actors?)

Re: Fearless concurrency in your microcontroller

#27
post #16

Earlier quoted context omitted.

You're not wrong, but this is sort of like saying that CPU's cost nothing, so just replace your i5 with 4 celerons. Distributed programming is even harder than multi-threaded programming if you need tightly coupled communication. Imagine you need to read an ADC (think oscilloscope output if you're not familiar) at 1MB/s and also need to be analyzing the data while talking to other devices on various peripherals about…

All problems disappear with enough speed. Eventually the main loop is fast enough that you can poll. If you're doing something truly cutting edge your competitors aren't better than you are so you can afford that second uC and more parts. Most of engineering judgment is finding the point where the goal is ambitious enough to keep up with or pass the competition while conservative enough that it'll likely work, or at…

You can't just thrown in more, beefier hardware with hard power and volume constraints.

Re: Fearless concurrency in your microcontroller

#28
post #12

Nice article. Some good insights, as well as beginner how-to steps. The embedded industry has proven to be very resistant to innovations and modern code-writing practices. Some platforms I coded for didn't even support/allow C99 standard. C++ is gaining some foothold (mbed, for example). Developers don't feel the urge to catch on with times, like in other industries. And yet, now they are expected to write secure IoT…

It was my understanding that C++ was being abandoned in the embedded world in favor of C due to the failure of UML. See for example, the intro of this (possibly outdated) article: http://embeddedgurus.com/state-space/2008/01/object-based-pr... Is this changing now?

Embedded C++ has been a thing for a while. The bigger issue is that one of the major compiler vendors only provides pre-standard C++ with no namespace std. C++11 is a pipe dream if you can't switch to a modern compiler. Still good enough for C with classes.

Re: Fearless concurrency in your microcontroller

#29
post #24

Earlier quoted context omitted.

No offense, but nobody in their right mind is going to use any of this in a production environment. For instance, what will your hypersonic rocket do while garbage collection is running instead of it's real-time control loops?

I guess the French and US military using Aonix real time JVMs for weapons control and monitoring are the right set of persons to answer your question. Also some military think memory leaks are irrelevant on missiles, given the ultimate garbage collector.

Heh - saw that on Twitter last week: https://twitter.com/pomeranian99/status/858856994438094848

"Memory leaks on missiles don't matter, so long as the missile explodes before too much leaks."

Re: Fearless concurrency in your microcontroller

#30
post #23

Earlier quoted context omitted.

Good point :) I probably should have stuck to picking on Java. Ada is a pretty good example of a language that handles real time use cases with concurrency and memory pools well. That said, it's fallen out of favor in "recent" years.

How many examples from military systems using real time Java do you want me to provide? I can also provide examples for energy motoring, copiers, factory control systems and phone infrastructures.

One mission critical system, where failure is not an option, such as on a hypersonic rocket.

One actual combat system - not a terminal for use on base, but something you have to rely on when people are shooting at you.

One.

Post reply on HN