Home |
RTKernel-32 - Real-Time Scheduler for On Time RTOS-32RTKernel-32 is a preemptive 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 CPUs.RTKernel-32 ThreadsAn 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 CommunicationRTKernel-32 offers three different mechanisms for inter-task communication:
PerformanceRTKernel-32 offers excellent performance. Its benchmark program RTBench (also included in the free 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 SchedulerRTKernel-32's scheduler is event-driven. It was developed specifically for real-time requirements and adheres to the following rules:
The application can dynamically change thread priorities and it can turn preemptions and time-slicing on and off at run-time. InterruptsThe 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 SupportRTKernel-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. DebuggingRTKernel-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 EmulationTo 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 ModulesRTKernel-32 is supplied with the following supplemental modules, always delivered with full source code:
|