2.8. Realtime

2.8.3. Memory Management

Memory locking guarantees fixed translation between virtual addresses (as seen by the process) and physical addresses.

2.8.4. Processing Scheduling

No scheduling policies beyond those specified are implemented.

The resolution of the execution time clock for the SCHED_SPORADIC policy is the same as the system clock resolution:

  • for CPU targets executing at less than 40 MHz, this is 10 milliseconds
  • for CPU targets executing at more than 40 MHz, this is 1 millisecond

The system clock resolution can be set using the QNX-specific ClockPeriod() kernel call using the CLOCK_REALTIME clock.

The SCHED_OTHER policy behaves identically to the SCHED_RR policy.

2.8.5. Clocks and Timers

The maximum possible clock jump for the system-wide monotonic clock is the same as the system clock resolution:

  • for CPU targets operating at less than 40 MHz, this is 10 milliseconds
  • for CPU targets operating at more than 40 Mhz, this is 1 millisecond

The system clock resolution can be set using the QNX-specific ClockPeriod() kernel call using the CLOCK_REALTIME clock.

The resolution for time services based on a supported clock is the same as the resolution of that clock.

2.9.4. Thread Scheduling

The default scheduling contention scope is PTHREAD_SCOPE_SYSTEM.

The PTHREAD_SCOPE_PROCESS contention scope isn't supported.

The default value of the inheritsched attribute is PTHREAD_INHERIT_SCHED. This means the default schedpolicy and schedparam attributes are inherited from the parent thread.

The PTHREAD_SCOPE_PROCESS scheduling contention scope isn't supported.

The system determines the scheduling allocation domain size on a per-thread basis using the concept of a runmask that indicates the processors on which the thread can be scheduled.

The default runmask for a thread is set to allow scheduling on all processors.

You can set a thread's runmask in the following ways:

  • You can use the QNX-specific slay utility to set the runmask for all threads in a specified process, or for a single specified thread in a process.
  • You can use the QNX-specific ThreadCtl() kernel call to set the runmask for the calling thread.

For threads with scheduling allocation domains of size greater than one, the rules defined for SCHED_FIFO, SCHED_RR, and SCHED_SPORADIC are followed such that if the thread becomes the head of its thread list, the thread may become the runnable thread on any processor in its scheduling allocation domain if it has a higher priority than the running thread on one of those processors.

This may in turn result in the preempted thread's becoming the running thread on a different processor if that thread also has a scheduling allocation domain of size greater than one and its priority is higher than the running thread on one of the other processors in its scheduling allocation domain.

If a thread's scheduling allocation domain has a size greater than one, a runnable thread selects the processor on which it becomes the runnable thread as follows:

  1. For each processor in the thread's scheduling allocation domain, find the processor whose running thread has the lowest priority that is less than this thread.
  2. If the search identifies only one processor, select that processor and make the thread the running thread on that processor.
  3. If the search identifies more than one processor, select the processor on which the thread previously ran before becoming a blocked thread.
  4. If the thread hadn't run on any of the selected processors before becoming a blocked thread, select the first processor that was found in the search.

For more information, see the Multicore Processing User's Guide .

No scheduling policies beyond SCHED_OTHER, SCHED_FIFO, SCHED_RR and SCHED_SPORADIC are implemented.