Multicore Processing
QNX OS supports multicore processing,
which entails concurrently running multiple threads in a multicore system.
A multicore system consists of two or more processors (i.e., CPUs or cores
) that share
the same memory and I/O devices, have the same instruction set architecture, and are managed by the
same OS instance.
The type of multicore processing that QNX OS supports is also known as symmetric multiprocessing (SMP).
Within the SMP execution environment, you can allow application threads to float (i.e., run)
on any CPU, or you can bind individual threads to specific CPUs.
We refer to this latter strategy as bound multiprocessing (BMP).
You can use BMP by defining runmasks, which are bitfields that indicate
the specific CPUs on which a thread may run.
A detailed explanation of runmasks is given later in
Processor affinity, clusters, runmasks, and inherit masks
.
For information about setting runmasks, see the ThreadCtl() runmask commands in the C Library Reference
and the Setting the runmask
section in the on entry in the
Utilities Reference.
It is important to remember that BMP is an application design choice whereas SMP is a software execution environment. By using floating threads (i.e., threads without CPU restrictions), you might get the best performance out of your system, depending on the behavior of your applications and hardware. But you might also want to dedicate specific application functions to specific CPUs (e.g., one processor handles the GUI, another handles the database, etc), in which case you can use the BMP strategy.
To determine how many CPUs there are on your system, look at the num_cpu entry in the system page. For more information, see the System Page chapter of Building Embedded Systems.
