Application Development Guidelines
To ensure the successful development of a real-time application, designers and developers must carefully analyze how to partition the application efficiently. They must also establish the correct balance between non-real-time (Windows) and real-time (RTSS) processes and determine their interface.
If, for example, there is time-critical processing in Windows processes, too much non-time-critical processing in RTSS processes, or too much synchronization or data flow across the process interfaces, the application's performance, usability, and overall ease of development and maintenance will be jeopardized. An initial investment of time spent analyzing the various tradeoffs and designs in this critical architecture area will be worthwhile to both developers and their users.
Testing Real-Time Applications
The wRTOS SDK supports debugging RTSS applications within the Microsoft Visual Studio environment (See Supported Visual Studio Versions). However, in some cases, the initial development and testing of real-time application components, including device drivers is most easily done in the Windows environment. Because of how wRTOS was designed, switching between a wRTOS-enabled application and an RTSS application requires no code changes.
Note: Some API calls are supported only in wRTOS. If you use any of those API calls, you cannot debug your application as a Windows application.
The only changes necessary relate to linking
the application. wRTOS provides a Visual Studio template that configures wRTOS-enabled applications and RTSS applications. Switching between
application types is as simple as selecting a different configuration.
Starting an RTSS Process
Several methods are available for starting RTSS processes. During development and testing, you will typically start RTSS processes from the wRTOS Task Manager or a command prompt with optional command line arguments or by double-clicking on the RTSS executable file icon in Windows Explorer. For final applications, you will generally use either the feature that starts specified RTSS processes automatically (that is, when the blue screen starts at boot time), or you might also launch RTSS processes directly from a Windows process. To create and launch the RTSS process directly, you will use the Windows RtCreateProcess call to create and start the specified RTSS process.
Stopping an RTSS Process
An RTSS process stops when:
- The process calls the ExitProcess function.
- The process generates an exception.
- The wRTOS Subsystem shuts down.
- A Windows system shutdown occurs (either a normal shutdown sequence or an exception-initiated Windows stop screen). Unless a process has a shutdown handler, in which case the shutdown handler will run to completion before the process is stopped.
- A user or a Windows process runs the wRTOS Task Manager or RtssKill utility available with wRTOS Runtime.
- A user terminates the process through the RTSS Task Manager.
Note: The last methods (RtssKill and terminating with RTSS Task Manager) do not provide a clean process stop and may cause unexpected results.