Day 1: Introduction to Real-Time & Multi-Core Programming
Fundamentals of Real-Time Systems
Real-time concepts and constraints
Multi-tasking and preemptive scheduling
Multi-core architectures and hyperthreading
Development Environment Setup (Exercise)
Install and configure the development and execution environments
Create a basic context switch routine
Thread-Safe Data Structures
Linked lists (single/double)
Circular lists, FIFOs, stacks
Data integrity verification (assertions, pre/post-conditions)
Exercise: Implement a thread-safe doubly linked list
Memory Management Strategies
Allocation algorithms: Buddy system, best-fit, first-fit, pool management
Exercise: Implement a simple thread-safe buddy system memory manager
Debugging memory errors (leaks, unallocated access)
Exercise: Enhance memory management to detect errors
Day 2: Real-Time System Components & Multi-Core Interactions
Real-Time Task Management
Task descriptors, lists, and context switching
Scheduling models (fixed priority, RMA, EDF, adaptive scheduling)
Exercise: Implement a basic fixed-priority scheduler
Interrupt Handling in Real-Time Systems
Time and device interrupts
Edge vs. level interrupts, vectoring, hardware/software acknowledgment
Exercise: Implement a basic interrupt manager
Multi-Core System Interactions
Cache coherence mechanisms (snooping, MOESI protocol)
Memory ordering, barriers, and DMA coherency
Exercise: Implement a spinlock for multi-core synchronization
Day 3: Multi-Core Scheduling & Synchronization Primitives
Multi-Core Scheduling
Assigning interrupts to processors
Optimizing cache usage (avoiding false sharing, cache spilling)
Exercise: Study a multi-core scheduler
Synchronization Mechanisms
Semaphores and mutexes (Exercise: Implement a mutex system)
Recursive and non-recursive mutexes (Exercise: Validate proper nesting)
Priority Inversion Problem
Solutions: Priority Inheritance vs. Priority Ceiling
Exercise: Implement priority ceiling for mutexes
Condition Variables & Mailboxes (Exercise: Add condition variable support to mutexes)
Day 4: Avoiding Sequencing Issues & POSIX Threads
Common Concurrency Problems & Solutions
Producer-consumer, deadlocks, livelocks, starvation
Exercise: Solve the dining philosophers problem
POSIX Thread Programming (Pthreads)
Thread management, mutexes, condition variables
Exercise: Solve the readers-writers problem using POSIX threads
Thread-local storage (Exercise: Implement per-thread static data storage)
POSIX semaphores, scheduling policies (real-time vs. traditional)
Day 5: Multi-Tasking in the Linux Kernel & Asymmetric Processing
Kernel-Level Multi-Tasking
Memory management (buddy/slab allocators)
Task handling (thread creation, termination)
Kernel Synchronization Primitives
Atomic operations, spinlocks, read/write locks, semaphores, sequential locks
Exercise: Implement a kernel-mode execution barrier
Kernel Timing Mechanisms
Hardware clocks, software timers, high-resolution timers
Exercise: Implement a kernel event synchronization object
Asymmetric Multiprocessing (AMP)
Architecture, shared memory challenges vs. SMP
Inter-Processor Communication (IPC)
OpenAMP framework, RemoteProc, rpmsg
Exercise: Implement message passing between AMP cores