Skip to content

PRO TIP Block youtube.com at the DNS level — Pi-hole, NextDNS or your hosts file — but allow youtube-nocookie.com and i.ytimg.com. These tutorials keep playing; the rabbit hole does not.

Learning without distractions

#44 Active Objects in Real-Time Part-2: Mutable Events

20.3K views on YouTube

This lesson continues the subject of Active Objects for Real-Time. Specifically, today you’ll see how the use of asynchronous, *mutable* events makes Active Objects even more suitable for hard real-time than traditional with a Real-Time Operating System (RTOS).

Contents with Timestamps:
————————-
1:40 Adding interactions among Active Objects, first with *sharing*
4:30 Race condition caused by sharing
6:05 Observing consequences of the race condition
8:00 Applying mutual exclusion for protection
9:20 Timing problems caused by mutual exclusion
10:40 Switching over to interactions via *events*
12:00 Naive approach with the static mutable event with parameters
13:30 Receiving event with parameters
15:50 Why static mutable events aren’t safe?
16:45 Framework-based, management of mutable events
18:50 Summary of “Zero-copy” event management
19:32 “The Law of Leaky Abstractions”
19:50 Ownership rules for mutable events

——-
Resources:

Companion web page for this video course:
https://www.state-machine.com/quickstart

GitHub repository for projects for this video course:
https://github.com/QuantumLeaps/modern-embedded-programming-course

Transcript of this lesson:
https://www.state-machine.com/course/lesson44.txt

Recommended Reading:
Book: “Practical UML Statecharts in C/C++, 2nd Edition”:
https://www.state-machine.com/doc/PSiCC2.pdf

Article: “The Law of Leaky Abstractions” by Joel Spolsky

The Law of Leaky Abstractions

Music credits:
The background music comes from:
https://www.bensound.com/royalty-free-music/track/straight