Jump to main content
Index
Advanced search
  1. Home
  2. QNX Software Development Platform

    QNX SDP is a cross-compiling and debugging environment, including an IDE and command-line tools, for building binary images and programs for target boards running the QNX OS 8.0.

  3. Programming
  4. Getting Started with the QNX OS

    Getting Started with the QNX OS: A Guide for Realtime Programmers is intended to introduce you to the QNX OS and help you develop applications and resource managers for it.

  5. Processes and Threads

    This chapter explains the concepts behind processes and threads, and the challenges of synchronization and scheduling. A thread is a flow of execution, and a process is a collection of threads. In the QNX OS, the schedulable entity is a thread, not a process.

  6. More on synchronization
  • QNX Momentics IDE User's Guide

    This User's Guide describes version 8.0 of the Integrated Development Environment (IDE) that's part of the QNX Tool Suite.

  • QNX Software Development Platform

    QNX SDP is a cross-compiling and debugging environment, including an IDE and command-line tools, for building binary images and programs for target boards running the QNX OS 8.0.

    • Quickstart Guide
    • System Architecture

      The System Architecture guide accompanies the QNX OS and is intended for both application developers and end-users.

    • OS Components & Operations
    • Graphics
    • Programming
      • Getting Started with the QNX OS

        Getting Started with the QNX OS: A Guide for Realtime Programmers is intended to introduce you to the QNX OS and help you develop applications and resource managers for it.

        • Processes and Threads

          This chapter explains the concepts behind processes and threads, and the challenges of synchronization and scheduling. A thread is a flow of execution, and a process is a collection of threads. In the QNX OS, the schedulable entity is a thread, not a process.

          • Process and thread fundamentals

            Before we start talking about threads, processes, time slices, and all the other wonderful scheduling concepts, let's establish an analogy.

          • The kernel's role

            The house analogy is excellent for getting across the concept of synchronization, but it falls down in one major area. In our house, we had many threads running simultaneously. However in a single-processor system, only one thing can run at once.

          • Threads and processes

            Let's return to our discussion of threads and processes, this time from the perspective of a real live system. Then, we'll take a look at the function calls used to deal with threads and processes.

          • More on synchronization
            • Readers/writer locks

              Readers and writer locks are used for exactly what their name implies: multiple readers can be using a resource, with no writers, or one writer can be using a resource with no other writers or readers.

            • Condition variables

              Another common situation that occurs in multi-threaded programs is the need for a thread to wait until something happens. This something could be anything! It could be the fact that data is now available from a device, or that a conveyor belt has now moved to the proper position, or that data has been committed to disk, or whatever. Another twist to throw in here is that several threads may need to wait for the given event.

            • Additional OS services

              QNX OS lets you do something else that's elegant. POSIX says that a mutex must operate between threads in the same process, and lets a conforming implementation extend this. QNX OS extends this by allowing a mutex to operate between threads in different processes.

            • Pools of threads

              Another thing that QNX OS has added is the concept of thread pools. You'll often notice in your programs that you want to run a certain number of threads but also to control the behavior of those threads within certain limits.

            • An example of synchronization

              Let's look at an example of synchronization in a multithreaded program.

          • Scheduling and the real world

            So far we've talked about scheduling policies and thread states, but we haven't said much yet about why and when things are rescheduled.

        • Message Passing

          In this chapter, we'll look at the most distinctive feature of QNX OS, message passing. Message passing lies at the heart of the operating system's microkernel architecture, giving the OS its modularity.

        • Interrupts

          In this chapter, we'll take a look at interrupts, how we deal with them under QNX OS, their impact on scheduling and realtime, and some interrupt-management strategies.

        • Resource Managers

          In this chapter, we'll take a look at what you need to understand in order to write a resource manager. Resource managers are another distintive feature of QNX OS that allow you to access services through standard POSIX calls.

        • Sample Programs

          This appendix contains the complete versions of some of the sample programs discussed in this book.

        • Glossary
      • Programmer's Guide

        The QNX OS Programmer's Guide covers a variety of topics that might interest developers who are building applications that will run under the QNX OS.

      • Writing a Resource Manager
    • System Security Guide

      The QNX System Security Guide is intended for both system integrators who are responsible for the security of a QNX OS system and developers who want to create a QNX OS resource manager free from vulnerabilities.

    • Utilities & Libraries
    • Migrating to QNX OS 8.0
  • QNX Software in the Cloud

    QNX Software in the Cloud enables developers to use the QNX OS in the Amazon cloud environment.

  • QNX Toolkit for Visual Studio Code

    This User's Guide describes the QNX® Toolkit for Visual Studio Code. The guide introduces you to the QNX Toolkit by explaining the QNX development environment and how to build, run, and debug your QNX® Operating System (OS) applications and systems.

  • QNX Hypervisor User's Guide

    This User's Guide explains the QNX hypervisor architecture and provides instructions for installing and running a QNX Hypervisor system, changing system components and configuration, and using hypervisor features such as virtual devices (vdevs).

  • Typographical Conventions, Support, and Licensing

    This section describes the typographical conventions used throughout the documentation, explains how to obtain technical support, and provides some information about licensing.

More on synchronization

QNX SDP8.0Getting Started with the QNX OSDeveloperUser

We've already seen:

  • mutexes
  • semaphores
  • barriers
Let's now finish up our discussion of synchronization by talking about:
  • readers/writer locks
  • condition variables (condvars)
  • additional OS services
  • pools of threads
followed by an example.
Page updated: March 05, 2025
Related information
  • Synchronization services (System Architecture)