|
The CreateThread function creates either an RTSS or a Win32 thread, depending on the current execution environment of the process. The initial thread of a process has an 8 KB stack. This size will not grow. It can only be altered by editing the Stack Reserve and Commit Size variables in the Visual Studio System Linker process properties.
You can specify the stack size of subsequently created threads of a process using CreateThread. The returned handle and thread ID are valid only in the CreateThread caller's environment. For instance, a Win32 process cannot manipulate the priority of an RTSS thread because the handle for the thread is valid only in the RTSS environment. You can, however, use the RTX Interprocess Communication (IPC) mechanisms (such as mutex objects, semaphores, events, and shared memory) to synchronize and communicate between Win32 and RTSS processes and threads.
Timer and interrupt objects derive from threads; therefore, the handles for these objects are valid only in their own (Win32 or RTSS) environment. Similarly, these objects can be manipulated only by processes in their own environment.
An RTSS thread is the unit of execution in the RTSS environment. A ready-to-run RTSS thread is scheduled based upon its priority. An RTSS thread runs until it gives up the CPU. A thread gives up the CPU when it: