Home |
RTKernel-32 Programming Manual Multitasking, Real-Time, and RTKernel-32 Alternate APIs for RTKernel-32 How to Create Threads Preemptive or Cooperative Multitasking? Starting Objects' Methods as Tasks Performance and Interrupt Response Times Task Switches in Cooperative Scheduling Using the FPU in Interrupt Handlers |
How to Create ThreadsRTKernel-32 programs can choose among several different methods to create threads:
At each level, the preceding level is called. Most applications should use level 4 or 3. Level 4 has the advantage that all RTKernel-32 parameters such as the thread's priority and flags are available. On the other hand, if portability between RTKernel-32 and Win32 is desired, level 3 might be better suited. Both level 3 and 4 use the multithread run-time system libraries, enabling such threads to call non-reentrant run-time system functions. Threads created with level 1 and 2 cannot use C++ exceptions, and they must take their own precautions when non-reentrant run-time system functions are called. Level 1 is well suited for simple tasks not requiring any non-reentrant run-time system services or exceptions. CreateThread does not support all RTKernel-32 thread creation parameters, but is Win32 compatible.
|