View the site in Français View the site in English (USA) Site displayed in English (GB)
You are here: ac6 > ac6-formation > Real time > Real Time and Multi-Core programming
Download Catalog
Download Catalog
Download as PDF
Download as PDF
Write us
Write us
Printable version
Printable version
 

RT1 Real Time and Multi-Core programming

Programming Linux real-time and multi-core systems, avoiding common pitfalls


formateur
Goals
bullet_jaune_1 Discover the concepts of real time multitasking
bullet_jaune_1 Understand the specificities of multicore processors
bullet_jaune_1 Master concurrent programming
bullet_jaune_2 on the same processor
bullet_jaune_2 on a multiprocessor system
bullet_jaune_1 Understand real time constraints
bullet_jaune_2 Determinism
bullet_jaune_2 Preemption
bullet_jaune_2 Interruptions
bullet_jaune_1 Interactions with processor architecture features
bullet_jaune_2 Cache
bullet_jaune_2 Pipeline
bullet_jaune_2 I/O optimisations
bullet_jaune_2 Multicore and Hyperthreading
bullet_jaune_1 Debug real time applications
bullet_jaune_1 Understand the structure of a real time kernel
This course helps you master multitask and real-time programming, understanding how to effectively solve problems using the primitives provided by the underlying Operating System.
Course material
bullet_jaune_2 Linux PC for each group of 2 trainees
bullet_jaune_2 Embedded target board
bullet_jaune_2 Cross compiler toolchain and debugger
bullet_jaune_2 Course slides hardcopy
bullet_jaune_2 Labs manual hardcopy
Prerequisite
bullet_jaune_2 Good knowledge of embedded C programming
bullet_jaune_2 Basic understanding of processor architecture
Pedagogic strategy
bullet_jaune_2 The exercises focus on using the mechanisms available to solve traditional problems: Readers-writers, producer-consumer, the dining philosophers, ...
bullet_jaune_2 Each exercise includes a detailed explanation and a diagram which helps to understand how the algorithm works.
bullet_jaune_2 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.
bullet_jaune_2 The course includes optional exercises to deepen understanding.

Outline
First day
Introduction to real time
bullet_jaune_2 Base real time concepts
bullet_jaune_2 The real time constraints
bullet_jaune_2 Multi-task and real-time
bullet_jaune_2 Multi-core and Hyperthreading
Exercice : Install the development environment on the host system (if needed)
Exercice : Install the execution environment on the target system
Exercice : Create a simple context switch routine
Thread safe data structures
bullet_jaune_2 Need for specific data structures
bullet_jaune_2 Thread safe data structures
bullet_jaune_3 Linked lists (simple or double links)
bullet_jaune_3 Circular lists
bullet_jaune_3 FIFOs
bullet_jaune_3 Stacks
bullet_jaune_2 Data structure integrity proofs
bullet_jaune_3 Assertions
bullet_jaune_3 Pre and post-conditions
Exercice : Build a general purpose thread safe doubly linked list
Second day
Memory management
bullet_jaune_2 Memory management algorithms
bullet_jaune_3 Buddy system
Exercice : Write a simple, thread safe, buddy system memory manager
bullet_jaune_3 Best fit
bullet_jaune_3 First fit
bullet_jaune_3 Pool management
Exercice : Write a generic, multi-level, memory manager
bullet_jaune_2 Memory management errors
bullet_jaune_3 memory leaks
bullet_jaune_3 using unallocated/deallocated memory
Exercice : Enhance the memory manager for memory error detection
bullet_jaune_3 stack monitoring
Exercice : Enhance the context switching infrastructure to monitor stack use
Elements of a real time system
bullet_jaune_2 Tasks and task descriptors
bullet_jaune_3 Content of the task descriptor
bullet_jaune_3 Lists of task descriptors
bullet_jaune_2 Context switch
bullet_jaune_2 Task scheduling and preemption
bullet_jaune_3 Tick based or tickless scheduling
bullet_jaune_2 Scheduling systems and schedulability proofs
bullet_jaune_3 Fixed priority scheduling
bullet_jaune_3 RMA and EDF scheduling
bullet_jaune_3 Adaptative scheduling
Exercice : Write a simple, fixed priority, scheduler
Third day
Interrupt management in real time systems
bullet_jaune_2 Need for interrupts in a real time system
bullet_jaune_3 Time interrupts
bullet_jaune_3 Device interrupts
bullet_jaune_2 Level or Edge interrupts
bullet_jaune_2 Hardware and software acknowledge
bullet_jaune_2 Interrupt vectoring
Exercice : Write a basic interrupt manager
bullet_jaune_2 Interrupts and scheduling
Exercice : Extend the scheduler to also support real-time round-robin scheduling
bullet_jaune_2 Assigning interrupts to processors
bullet_jaune_2 Multi-processor scheduling
Exercice : Study of a multi-processor scheduler
Synchronisation primitives
bullet_jaune_2 Waiting and waking up tasks
bullet_jaune_2 Semaphores
Exercice : Implement Semaphores by direct interaction with the scheduler
bullet_jaune_2 Mutual exclusion
bullet_jaune_3 Spinlocks and interrupt masking
bullet_jaune_3 Mutexes or semaphores
Exercice : Implement the mutex mechanism
bullet_jaune_3 Recursive and non-recursive mutexes
Exercice : Check proper nesting of mutexes and recursive/non-recursive use
bullet_jaune_3 The priority inversion problem
bullet_jaune_3 Priority inheritance (the automagic answer)
bullet_jaune_3 Priority ceiling (the design centric answer)
Exercice : Implement a priority ceiling mechanism
bullet_jaune_2 Mutexes and condition variables
Exercice : Add Condition variable support to the mutex mechanism
bullet_jaune_2 Mailboxes
Fourth day
Avoiding sequencing problems
bullet_jaune_2 The various sequencing problems
bullet_jaune_3 Uncontrolled parallel access
Exercice : The producre-consumer problem, illistrating (and avoiding) concurrent access problems
bullet_jaune_3 Deadlocks
bullet_jaune_3 Livelocks
bullet_jaune_3 Starvation
Exercice : The philosophers dinner problem, illustrating (and avoiding) deadlock, livelock and starvation
Working with Pthreads
bullet_jaune_2 The pthread standard
bullet_jaune_3 threads
bullet_jaune_3 mutexes and condition variables
Exercice : Solve the classic readers-writers problem with POSIX threads
bullet_jaune_3 Thread local storage
Exercice : Maintain per-thread static data for the readers-writers problem
bullet_jaune_2 POSIX semaphores
bullet_jaune_2 Scheduling
bullet_jaune_3 context switches
bullet_jaune_3 scheduling policies (real-time, traditional)
bullet_jaune_3 preemption
Fifth day
Multi-tasking in the Linux kernel
bullet_jaune_2 Kernel memory management
bullet_jaune_3 "buddy" and "slab" memory allocation algorithms
bullet_jaune_2 Kernel task handling
bullet_jaune_2 Linux kernel threads
bullet_jaune_3 creation
bullet_jaune_3 termination
bullet_jaune_2 Concurrent kernel programming
bullet_jaune_3 atomic operations
bullet_jaune_3 spinlocks
bullet_jaune_3 read/write locks
bullet_jaune_3 semaphores and read/write semaphores
bullet_jaune_3 mutexes
bullet_jaune_3 sequential locks
bullet_jaune_3 read-copy-update
Exercice : Create a kernel-mode execution barrier using kernel synchronisation primitives
bullet_jaune_2 Basic thread synchronisation
bullet_jaune_3 waiting queues
bullet_jaune_3 completion events
bullet_jaune_2 Hardware clocks
bullet_jaune_3 clockevents
bullet_jaune_2 Software clocks
bullet_jaune_3 delayed execution
bullet_jaune_3 kernel timers
bullet_jaune_3 high resolution timers
Exercice : Create a kernel event synchronisation object, using basic synchronisation primitives