RT1Real Time and Multi-Core programming
Programming Linux real-time and multi-core systems, avoiding common pitfalls
|
Goals
|
|||
- Linux PC for each group of 2 trainees
- Embedded target board
- Cross compiler toolchain and debugger
- Course slides hardcopy
- Labs manual hardcopy
- Good knowledge of embedded C programming
- Basic understanding of processor architecture
- The exercises focus on using the mechanisms available to solve traditional problems: Readers-writers, producer-consumer, the dining philosophers, ...
- Each exercise includes a detailed explanation and a diagram which helps to understand how the algorithm works.
- For each exercise there an almost complete code is provided, with parts to complete; this allows, after a phase of understanding of the provided code, to implement features that usually take hours to design.
- The course includes optional exercises to deepen understanding.
- Any embedded systems engineer or technician with the above prerequisites.
- The prerequisites indicated above are assessed before the training by the technical supervision of the traineein his company, or by the trainee himself in the exceptional case of an individual trainee.
- Trainee progress is assessed in two different ways, depending on the course:
- For courses lending themselves to practical exercises, the results of the exercises are checked by the trainer while, if necessary, helping trainees to carry them out by providing additional details.
- Quizzes are offered at the end of sections that do not include practical exercises to verifythat the trainees have assimilated the points presented
- At the end of the training, each trainee receives a certificate attesting that they have successfully completed the course.
- In the event of a problem, discovered during the course, due to a lack of prerequisites by the trainee a different or additional training is offered to them, generally to reinforce their prerequisites,in agreement with their company manager if applicable.
Course Outline
- Base real time concepts
- The real time constraints
- Multi-task and real-time
- Multi-core and Hyperthreading
| Exercise: | Install the development environment on the host system (if needed) | |
| Exercise: | Install the execution environment on the target system | |
| Exercise: | Create a simple context switch routine | |
- Need for specific data structures
- Thread safe data structures
- Linked lists (simple or double links)
- Circular lists
- FIFOs
- Stacks
- Data structure integrity proofs
- Assertions
- Pre and post-conditions
| Exercise: | Build a general purpose thread safe doubly linked list | |
- Memory management algorithms
- Buddy system
| Exercise: | Write a simple, thread safe, buddy system memory manager | |
- Best fit
- First fit
- Pool management
| Exercise: | Write a generic, multi-level, memory manager | |
- Memory management errors
- memory leaks
- using unallocated/deallocated memory
| Exercise: | Enhance the memory manager for memory error detection | |
- stack monitoring
| Exercise: | Enhance the context switching infrastructure to monitor stack use | |
- Tasks and task descriptors
- Content of the task descriptor
- Lists of task descriptors
- Context switch
- Task scheduling and preemption
- Tick based or tickless scheduling
- Scheduling systems and schedulability proofs
- Fixed priority scheduling
- RMA and EDF scheduling
- Adaptative scheduling
| Exercise: | Write a simple, fixed priority, scheduler | |
- Need for interrupts in a real time system
- Time interrupts
- Device interrupts
- Level or Edge interrupts
- Hardware and software acknowledge
- Interrupt vectoring
| Exercise: | Write a basic interrupt manager | |
- Interrupts and scheduling
| Exercise: | Extend the scheduler to also support real-time round-robin scheduling | |
- Cache coherency
- Snooping basics
- Snoop Control Unit: cache-to-cache transfers
- MOESI state machine
- Memory Ordering and Coherency
- ut-of-order accesses
- Memory ordering
- Memory barriers
- DMA data coherency
- Multicore data access
- Read-Modify-Write instructions
- Linked-Read/Conditional-Write
- Multicore synchronization
- Spinlocks
- Inter-Processor Interrupts
| Exercise: | Writing a spinlock implementation | |
- Multicore scheduling
- Assigning interrupts to processors
- Multi-core scheduling
- Multicore optimization
- Cache usage optimization
- Avoiding false sharing
- Avoiding cache spilling
| Exercise: | Study of a multi-core scheduler | |
- Waiting and waking up tasks
- Semaphores
| Exercise: | Implement Semaphores by direct interaction with the scheduler | |
- Mutual exclusion
- Spinlocks and interrupt masking
- Mutexes or semaphores
| Exercise: | Implement the mutex mechanism | |
- Recursive and non-recursive mutexes
| Exercise: | Check proper nesting of mutexes and recursive/non-recursive use | |
- The priority inversion problem
- Priority inheritance (the automagic answer)
- Priority ceiling (the design centric answer)
| Exercise: | Implement a priority ceiling mechanism | |
- Mutexes and condition variables
| Exercise: | Add Condition variable support to the mutex mechanism | |
- Mailboxes
- The various sequencing problems
- Uncontrolled parallel access
| Exercise: | The producre-consumer problem, illistrating (and avoiding) concurrent access problems | |
- Deadlocks
- Livelocks
- Starvation
| Exercise: | The philosophers dinner problem, illustrating (and avoiding) deadlock, livelock and starvation | |
- The pthread standard
- threads
- mutexes and condition variables
| Exercise: | Solve the classic readers-writers problem with POSIX threads | |
- Thread local storage
| Exercise: | Maintain per-thread static data for the readers-writers problem | |
- POSIX semaphores
- Scheduling
- context switches
- scheduling policies (real-time, traditional)
- preemption
- Kernel memory management
- "buddy" and "slab" memory allocation algorithms
- Kernel task handling
- Linux kernel threads
- creation
- termination
- Concurrent kernel programming
- atomic operations
- spinlocks
- read/write locks
- semaphores and read/write semaphores
- mutexes
- sequential locks
- read-copy-update
- hardware spinlock
| Exercise: | Create a kernel-mode execution barrier using kernel synchronisation primitives | |
- Basic thread synchronisation
- waiting queues
- completion events
- Hardware clocks
- clockevents
- Software clocks
- delayed execution
- kernel timers
- high resolution timers
| Exercise: | Create a kernel event synchronisation object, using basic synchronisation primitives | |
- AMP overview
- Architecture
- Shared memory
- Challenges comparing to SMP
- Inter-processor communication
- OpenAMP framework
- Remoteproc
- rpmsg
| Exercise: | Sending messages between AMP cores | |
More
To book a training session or for more information, please contact us on info@ac6-training.com.
Registrations are accepted till one week before the start date for scheduled classes. For late registrations, please consult us.
You can also fill and send us the registration form
This course can be provided either remotely, in our Paris training center or worldwide on your premises.
Scheduled classes are confirmed as soon as there is two confirmed bookings. Bookings are accepted until 1 week before the course start.
Last update of course schedule: 23 February 2026
Booking one of our trainings is subject to our General Terms of Sales
Related Courses
MC4
Multi-Core Programming with OSEK/VDX and AutoSAR
NR3
NXP + FreeRTOS + West
NR6
NXP + ThreadX + West
NRF5
nRF Connect SDK Programming
RT3
FreeRTOS Real Time Programming
RT5
Zephyr RTOS Programming
RT6
Real Time Programming with Eclipse ThreadX
RT7
Real Time Programming with RT-Thread
RTW
West, MCUXpresso SDK and Kconfig