\"\" \"\" \"\"
Go backward to Execution Model
Go up to Program Control
Go forward to RT++ Type Declarations
RISC-Linz logo

Program Structure

The basic structure of an RT++ program is as follows:
#include <rt++.h>

...

int my_main(int argc, char *argv[])
{
  ...
}

int main(int argc, char *argv[])
{
  ...
  RT_Argument rtarg;
  RT_Result rtres;
  ...
  int code = rt_main(my_main, argc, argv, rtarg, &rtres);
  ...
}
 

The call of rt_main transfers control from the C++ program to a thread that executes the function denoted by my_main (the main thread). The argument rtarg is used to set up the RT++ runtime environment while rtres delivers statistical information after termination of the RT++ program. code contains the return code of the RT++ program.

An RT++ program is basically an extension of a C++ program. However, there are several restrictions that deal with the fact that the RT++ program threads are generally executed by different processes.


Author: Wolfgang Schreiner
Last Modification: April 12, 1997