|
On Time RTOS-32 Documentation
Welcome
RTTarget-32
RTKernel-32
RTKernel-32 Programming Manual
Introduction
Multitasking, Real-Time, and RTKernel-32
Module RTKernel-32
Alternate APIs for RTKernel-32
Supplemental Modules
RTKernel-32 Drivers
Demo Programs
Advanced Topics
RTKernel-32's Debug Version
How to Create Threads
Interrupt Handling
Avoid Polling
Preemptive or Cooperative Multitasking?
Waiting for Several Events
Avoid Large Message Types
Mutual Exclusion
Avoid Time Slicing
Cyclic Tasks (Timer)
Priorities
Starting Objects' Methods as Tasks
Creating and Terminating Tasks
Performance and Interrupt Response Times
Multiprocessor Applications
OpenMP
Task Switches in Cooperative Scheduling
Writing Custom Kernel Drivers
Typical Error Sources
Error and Information Messages
RTKernel-32 Reference Manual
RTFiles-32
RTIP-32
RTPEG-32
RTUSB-32
|
Creating and Terminating Tasks
Creating and terminating tasks frequently should be avoided. On the one hand, this can lead to heavy heap fragmentation, possibly making the creation of new tasks impossible. RTKCreateThread and RTKTerminateTask are among RTKernel-32's most involved operations. Their time requirements are not deterministically predictable.
Moreover, blocked tasks do not incur a performance penalty. Therefore, it is recommended to create all tasks of an application at program startup. If a task has nothing to do temporarily, it should wait in a blocked task state until it is reactivated.
Advanced Topics
Starting Objects' Methods as Tasks
Performance and Interrupt Response Times
|