Keil Logo

Product Description

The RTX kernel provides basic functionality to start and stop concurrent tasks (processes). RTX provides additional functions for inter-process communication. Use the communication functions to synchronize tasks, manage common resources (like peripherals or memory regions), and pass complete messages between tasks (round-robin scheduling).

Developers can assign execution priorities to tasks. When more tasks exists in the ready list, the RTX kernel uses the execution priorities to select the next task to run (preemptive scheduling).

The RTX kernel provides several ways for inter-process communication. These are:

  • Event flags
    Event flags are the primary instrument for implementing task synchronization. Each task has 16 event flags assigned to it. Hence, a task can selectively wait for 16 different events at the same time. In this case, the task can wait for all the selected flags (AND-connection), or wait for any one of the selected flags (OR-connection).

    Event flags can be set either by tasks or by ARM interrupt functions. Synchronize an external asynchronous event to an RTX kernel task by making the ARM interrupt function set a flag that the task is waiting for.
  • Semaphores
    If more than one task needs to access a common resource, special means are required in a real time multitasking system. Otherwise, accesses by different tasks might interfere and lead to inconsistent data, or a peripheral element might function incorrectly.

    Semaphores are the primary means of avoiding such access problems. Semaphores (binary semaphores) are software objects containing a virtual token. The kernel gives the token to the first task that requests it. No other task can obtain the token until it is released back into the semaphore. Since only the task that has the token can access the common resource, it prevents other tasks from accessing and interfering with the common resource.

    The RTX kernel puts a task to sleep if the requested token is not available in the semaphore. The kernel wakes-up the task and puts it in the ready list as soon as the token is returned to the semaphore. It is possible to use a time-out to ensure the task does not sleep indefinitely.
  • Mutexes
    Mutual exclusion locks (mutexes) are an alternative to avoid synchronization and memory access problems. Mutexes are software objects that a task can use to lock the common resource. Only the task that locks the mutex can access the common resource. The kernel blocks all other tasks that request the mutex until the task that locked the mutex unlocks it.
  • Mailboxes
    Tasks can pass messages between each other using mailboxes. This is usually the case when implementing various high level protocols like TCP-IP, UDP, and ISDN.

    The message is simply a pointer to the block of memory containing a protocol message or frame. It is the programmer's responsibility to dynamically allocate and free the memory block to prevent memory leaks.

    The RTX kernel puts the waiting task to sleep if the message is not available. The kernel wakes the task up as soon as another task sends a message to the mailbox.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.