Course Overview

Course Length: 
2 Days

When it comes to writing multithreaded code, there is a dangerous mix of vendor propaganda and programmer misunderstanding in the embedded systems design community. Those who sell tools, such as real-time operating systems (RTOSes), too often fail to educate their customers in the subtleties of their proper use. And in an industry dominated by self-taught programmers who were formally educated in electrical engineering, there is typically insufficient knowledge of necessary portions of computer science. This combination reduces product reliability and sometimes also puts human life and limb at risk.

Barr Group's Reliable Multithreaded Programming course is an advanced, efficient, and cost-effective hands-on training program for embedded software architects and developers. In just 2-days and through a mix of lectures and programming exercises on actual embedded hardware, attendees learn how to architect and implement multithreaded software for reliable and safe operation. Back at the office, attendees will be able to immediately put the principles learned in this class to use whether their current architecture is based on cooperative or preemptive multithreading and with any OS from Linux to none-at-all.

Topics covered during this course include:

  • Introduction to multithreaded programming
  • Cooperative Multithreading
  • Real-Time Operating Systems
  • Preventing Starvation and Deadlock
  • Multithreading in Linux
  • Pros and Cons of Preemption
  • Event-Driven Programming

Attendees will independently complete approximately half a dozen hands-on programming exercises. These exercises are interspersed with the lectures. Attendees will use their computer to compile their programs and then download them for execution on an embedded target board with its own processor, memory, and peripherals.

This course is appropriate for:

  • Embedded software developers
  • Embedded software architects

Prerequisites:  Attendees should already be familiar with the C or C++ programming language before taking this course. Prior experience programming for one or more operating systems may be beneficial but is not necessary.

Requirements:  Each student will need a computer, such as a laptop, running XP or a newer version of Windows with an available USB port and administrator privileges. (Windows over Mac OS X generally works.)

Explore this course:

Find out more:


The following is a summary of the major course topics and are not the section-by-subsection lecture breakdown.


  • Types of Threads
  • Reasons to Multithread
  • Reliability/Safety Risks

Cooperative Multithreading

  • Syncing main() with ISRs
  • Timing & Cyclic Executives
  • Function Queues

Real-Time Operating Systems

  • How Preemption Works
  • Mutual Exclusion
  • Intertask Communication

Preventing Starvation and Deadlock

  • Ensuring Deadlines are Met
  • Avoiding Priority Inversion
  • Managing Dynamic Memory
  • Watchdog Supervisor Design

Multithreading in Linux

  • Processes vs. Threads
  • Inter-Process Communications
  • Kernel Threads and ISRs
  • Real-Time Linux

Pros and Cons of Preemption

  • Top 3 Advantages
  • The 10 Risks/Costs

Event-Driven Programming

  • The Event-Reaction Model
  • Managing Event Queues
  • Implementing State Machines
  • Run-to-Completion Steps
  • Cooperating Active Objects

Key Takeaways

Related Courses

Find out More

Contact us now to find out more about this course or to enquire about an on-site training at your company.

Recording Policy

Barr Group's courses may not be audiotaped, videotaped, or photographed without consent from Barr Group's executive team.