logoalt Hacker News

apitmanlast Friday at 5:23 AM3 repliesview on HN

The claim is you can get embedded concurrency without an OS. Do you disagree?

I prefer C for embedded but must admit that's pretty compelling.


Replies

adastra22last Friday at 1:17 PM

The claim is it "obsoletes the need for a traditional RTOS with kernel context switching."

I don't think the authors understand what an RTOS is, because it has very little to do with concurrency. It is about providing hard guarantees about execution timing of interrupt events. E.g. you need to poll an input port every 20ms, or something like that, because that's when the signal will be on the wire. Not "Please wait at least 20ms before resuming" but rather "I must resume execution in +0.020 sec from now with timing error constrained to no more than +/- 100 nanoseconds"

This is traditionally done by having an operating system with deterministic timing in its interrupt handling, so that it can schedule preemptive wake-up calls exactly when needed. As well as some important edge case handling like fast queueing of interrupts for later processing, or even dropping them entirely if a hard scheduled interrupt is being processed. Preemptive execution and OS threading is an absolute requirement.

Async rust doesn't even provide hard interrupts. It's cooperative multithreading so if some other event handler happens to be running when you need to resume, you're boned.

So AFAICT Embassy doesn't do this at all? In which case it doesn't "obsolete the need for a traditional RTOS with kernel context switching."

show 3 replies
zipy124last Friday at 11:03 AM

There isn't much difference between this and an OS. It's just that in an OS you switch between processes, whereas here they switch between async tasks. One could argue this is pretty semantic and that you could easily just call this an OS.

5d41402abc4blast Friday at 8:47 AM

If it has async and concurrency isnt this an OS?