Beyond the RTOS - Part 1: Concurrency & "spaghetti" as main challenges of professional developers
HTML-код
- Опубликовано: 28 авг 2020
- This is part-1 of the talk "Modern Embedded Software Goes Beyond the RTOS" that Miro Samek presented at the [Embedded Online Conference in May 2020](www.embeddedonlineconference.....
This part describes the main challenges faced by professional embedded software developers. Then the presentation goes over the main, currently dominating approaches, which are "superloop" and traditional Real-Time Operating System (RTOS). This part ends with summarizing the benefits and perils of the traditional approaches.
The next part will discuss the best practices of concurrent programming and how they address the problems identified in part-1.
End Notes:
----------
More information about the concepts covered in this video:
www.state-machine.com/reactiv...
www.state-machine.com/sequent...
www.state-machine.com/event-d...
The best RTOS video course on RUclips:
• RTOS
Music credits:
The background music comes from:
www.bensound.com/royalty-free... Наука
Thank you for the free lectures, I absolutely love your teaching style.
really helpful mr, i just finished to manage superloop programming and ready to leard this new paradigm, very well explained from you, thank you
As aspiring embedded systems developer your lectures really help me a lot. Thank you!
The greatest embedded software training on youtube ever 😍
Thank you very much for your amazing lectures
Thanks a lot again for your amazing lectures
great as usual.
This is the best!
You are an inspiration, do you see registers in the palm of your hand ?
Thanks a lot, keep the way !!
Again an excellent video
Thank you for sharing
He back.
Dr. Samek, is there any chance you organise virtual classes for students who wish to bring up their skills in a fast track manner during the period of a week etc??
I believe I've been creating such a self-paced learning opportunity with my "Modern Embedded Programming" video course since 2013 (see www.state-machine.com/quickstart). And it has been quite a bit of work... The course has now 35 lessons, which can be watched within a week or so. The course starts with the fundamentals, but quickly progresses to more advanced topics, including interrupts, RTOS, object-oriented programming, and now event-driven programming. Please give it a try! --MMS
Hi,
I'm a junior embedded system engineer and I've been reading the 200 first pages of the second edition of your book. I find really innovative how you design embedded systems and I missed such a methodological approach in the work I have performed until now.
Also I'm hesitating between continuing the reading of your book or starting watching your youtube videos. What do you think is the best ? Thanks
The "Practical UML Statecharts" book is intended for professional developers, because it assumes familiarity with many embedded concepts. As a junior engineer, you might not quite see *why* you should care for the described concepts, because you haven't yet made "all the mistakes that could be made in this narrow field". That's exactly the reason why I've created this video course. The purpose of this course is to bridge the gap from a beginner to more advanced embedded developer. --MMS
@@StateMachineCOM Thank you for your detailed answer. In fact, I lead the development of the embedded software of an instrument for a biotech startup. I have no experience in designing such complex system and I absolutely want to avoid the most common mistakes leading to spaghetti code.
I'll start watching your videos, but I find that you have well shown in your book the pros of your technique.
@@Mugnize hi, can I get the link or access to that book?
Interesting topic! I have 2 questions:
1. For this specific task (blinky + button), button can be done in a Pin Change ISR, and blinky can be done in a Timer ISR. Wouldn't utilizing these ISRs on Arduino make it "seemingly" concurrent as well?
2. At 14:02, how could the processor know that the delay was about to elapse if it's running another thread? Is there any specific hardware that does the timekeeping?
Yes, utilizing interrupts and ISRs (Interrupt Service Routines) would make the code execute "seemingly" concurrently as well. In that particular case the actual work to do is so minimal that it can be all implemented inside the ISRs. But in general, if you have more to do, ISRs would be too long, which would create other problems. For that reasons people have invented RTOS and threads.
Regarding the RTOS delay, you are absolutely right that there is a specific hardware that does the timekeeping. This is called the "system clock tick", which is a periodic interrupt that calls the RTOS's tick-service. In that tick-service the RTOS "knows" that some threads need to be unblocked. Please also watch the lessons on RTOS, where all of this is explained: ruclips.net/p/PLPW8O6W-1chyrd_Msnn4LD6LBs2slJITs . --MMS
@@StateMachineCOM Thank you for the great answer! Indeed, when the complexity increases, ISRs start to become a problem. I'll be sure to watch your RTOS videos!
A very nice explanation! Thank you.
So even in a single core/thread CPU system, we can get speedup just by using an RTOS instead of plain C-code!
However, I have one doubt. Is threading possible without any OS? In plain C- code, can we run 2 threads simultaneously? For pthreads, we need UNIX like OS, but what about other threading techniques?
As I mentioned in the presentation, if you'd like to learn more about multithreading and how it really works in a small microcontroller, you could watch my RTOS video series (ruclips.net/p/PLPW8O6W-1chyrd_Msnn4LD6LBs2slJITs ). But, yes, typically, for multithreading you do need a kernel, either RTOS kernel or Linux kernel (for p-threads). But such traditional kernels are not the only game in town. I plan to talk about other types of kernels (e.g., preemptive, but *non-blocking* kernels) in my ongoing Modern Embedded Programming course (ruclips.net/p/PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM ). --MMS
@@StateMachineCOM Thank you Miro :). I will definitely watch the RTOS series, your channel has really high quality contents :)
Great lecture...loved it!
are there more videos coming up to finish the agenda of this conference?
Yes, there will be 3 more parts of this presentation coming up soon. Stay tuned! --MMS
@@StateMachineCOM Great work!!!!!
I'm looking forward to use QPC on ESP32. Is there any project to port this to esp?
A QP port to FreeRTOS-ESP32 has been added in QP/C 6.9.1. You can download it as "QP-bundle" from www.state-machine.com/#Downloads or directly from GitHub: github.com/QuantumLeaps/qpc
Your videos are always great. I have a question, what do you mean by assigning separate CPU for each task? If we have single core machine, how can we get separate CPU for each task? _____Or it is for some specific period of time?
I don't think I said "separate CPU for each task". I did say that the main job of an RTOS is to create an illusion that each task (a.k.a. thread) has the CPU all to itself, which has a different meaning. But anyway, the point is that from the application developer's point of view it's indistinguishable whether a thread really has a separate CPU, or the CPU is shared among many threads at different times. --MMS
@@StateMachineCOM Got it, Thanks
Hi Miro. You are the best teacher. Could you teach us how to write makefiles, cmake?
there are plenty of tutorials about that. Make is ubiquitous, but it is like learning klingon to build C programs. I use python invoke module. For bigger programs you can use Meson. Please send me some of the money you save from your visits to the psychologist.
HELLO BEAUTIFULL (>^______^