RTKernel-32
Real-Time Scheduler for On Time RTOS-32
RTKernel-32 is a preemtive real-time multitasking scheduler for On Time RTOS-32. RTKernel-32 is compact (about 16k code, 6k data), fast, and offers excellent real-time response times. All RTKernel-32 threads run within a single program (single process, multi-threaded). The multiprocessor version of RTKernel-32 supports up to 32 CPU cores.
RTKernel-32 Threads
An RTKernel-32 thread is implemented as a C/C++ function. A program can dynamically create threads using the appropriate kernel API calls. Each thread has its own stack, a priority between 1 and 256, and a task state. Several threads can be started executing the same code; however, each is allocated its own stack and thus its own local variables. All threads have access to the program's global data. Thus, shared code and shared data are inherently implemented by RTKernel-32. |
|
Inter-Task Communication
RTKernel-32 offers three different mechanisms for inter-task communication:
- Semaphores allow the exchange of signals for activating and suspending threads. RTKernel-32 supports counting, binary, event, resource, mutex semaphores, and critical sections. Resource and mutex semaphores implement priority inheritance.
- Mailboxes (queues or FIFO buffers) allow threads to exchange messages asynchronously. The maximum number and size of messages can be configured for each mailbox. High priority messages can be sent to a mailbox ahead of all others. Mailboxes can also be used to send data from hardware interrupt handlers to threads.
- Message-passing is used for synchronous (rendezvous style) exchange of messages. No data is buffered, data is sent directly from one thread to another.
Performance
RTKernel-32 offers excellent performance. Its benchmark program RTBench (also included in the On Time RTOS-32 Evaluation Kit) may be used to measure its performance on any target computer. The table below lists some results for three different targets. RTKernel-32's scheduler is about 5 times faster than the scheduler of Windows.
The Scheduler
RTKernel-32's scheduler is event-driven. It was developed specifically for real-time requirements and adheres to the following rules:
- Priority Scheduling
Of all threads in state Ready, the thread with the highest priority runs.
- Round-Robin Scheduling
If the kernel must choose from several Ready threads with the same priority, the thread that hasn't run for the longest time is activated.
- Priority Ordered Queues
If several threads are waiting for an event, they are activated upon the occurrence of that event in sequence of their priorities.
- Deterministic Scheduling
With the exception of time-slice task switches, a task switch is only performed if otherwise rule 1 would be violated.
The application can dynamically change thread priorities and it can turn preemptions and time-slicing on and off at run-time.
Interrupts
The application's interrupt handlers can suspend or activate threads. Interrupt handlers can be programmed completely in C/C++ within the application. They can freely exchange signals or data with threads using semaphores or mailboxes. Semaphore or mailbox operations may then initiate a task switch, if required. Interrupts from any hardware can be processed. Interrupt sharing for PCI devices is also supported. If APIC mode is enabled, up to 32 unique IRQs can be used.
Multiprocessor Support
RTKernel-32 includes two schedulers: the single-CPU scheduler and a multiprocessor scheduler which can manage up to 32 CPUs (multi-cores, multi-CPUs, Hyperthreads, or a combination thereof). The multiprocessor scheduler automatically distributes threads among all available CPUs. If an OpenMP compatible compiler such as Microsoft Visual Studio is used, parallel algorithms can be distributed onto all available CPUs automatically through compiler directives.
Debugging
RTKernel-32 is delivered in two versions. The Standard version is optimized for minimum size and best performance, while the Debug version contains additional code for parameter and consistency checks at run-time. The Debug version recognizes usage errors and issues corresponding error messages. Moreover, the Debug version offers various debugging aids. For example, the current source code position of a thread can be displayed, all locked resources can be listed, or the CPU time requirements can be determined for each thread and interrupt handler. Additional powerful tools are the Performance Profiler and the Kernel Tracer which can log kernel and application events in real-time for off-line analysis.
As an additional aid to debugging, RTKernel-32 (Debug and Standard version) offers a number of informational functions. For example, a list of all threads, semaphores, or mailboxes can be displayed, or the state of a specific thread can be queried. RTKernel-32 can also determine the current and maximum stack usage of each thread and interrupt handler.
Win32 Emulation
To allow porting existing multithreaded programs from Win32, almost all Win32 thread API functions are supported by RTKernel-32. Applications can use Win32 threads, events, mutexes, semaphores, and critical sections. Unlike Windows, RTKernel-32 allows hardware interrupt handlers and hardware accesses within the application code.
Supplemental Modules
RTKernel-32 is supplied with the following supplemental modules, always delivered with full source code:
- FineTime - High resolution time measurement
- Clock - Timer interrupt management
- RTCom - Interrupt-driven serial I/O for up to 38 ports
- RTKeybrd - Keyboard support
- RTTextIO - Text mode screen window management
- CPUMoni - CPU load analysis
- RTProf - Performance profiler
For more information please contact
the MicroWay sales team: |
 |
Head Office
MicroWay Pty Ltd
PO Box 84,
Braeside, Victoria, 3195, Australia
Ph: 1300 553 313
Fax: 1300 132 709
email: sales@microway.com.au
ABN: 56 129 024 825 |
Sydney Sales Office
MicroWay Pty Ltd
PO Box 1733,
Crows Nest, NSW 1585, Australia
Tel: 1300 553 313
Fax: 1300 132 709
email: sales@microway.com.au
ABN: 56 129 024 825 |
New Zealand Sales Office
MicroWay Pty Ltd (NZ)
PO Box 912026
Victoria Street West
Auckland 1142, New Zealand
Tel: 0800 450 168
email: sales@microway.co.nz |
International: call
+61 3 9580 1333, fax +61 3 9580 8995
|
|