![]() |
![]() |
![]() |
![]() |
![]() |
Annex 6: Building a Threaded Integration
Introduction
This Tutorial, on how to create a Threaded integration, is developed on a Windows machine and is intended to be run under a Windows OS.
If you want to use this example on another machine and for another OS, please remember to choose the appropriate integration and compiler for your OS in the Targeting Expert.
The source file and examples for RTOS Integrations are not included in the standard delivery. They are available as free downloads from the IBM Rational Support web site.
Preparations
The same SDL source files for the example Simple, that is used in the Light integration example will be used in this tutorial.
Copy the Source files for the Example: Simple
- Create your own test directory and enter it.
- Copy the SDL source files for the example Simple:
- Copy the environment file from the Win32/ThreadedIntegration directory:
- Start the SDL Suite and open the system file for the Simple example.
Partition the system using the Deployment Editor
- Create a new deployment diagram and call it Simple.
- Edit the deployment diagram according to the figure below, see : Signalling in Threaded Integration.
- Make sure that you got the multiplicity right on the aggregation line from the component to thread.
- Double-click the component symbol. In the Symbol Details window specify that the integration model should be Threaded, see : Signalling in Threaded Integration.
- Double-click the thread symbol for Pr1. Specify the following Thread Parameters for the Thread P1:
- Double-click the object symbol and specify that the stereotype should be Process and that the qualifier (for Pr1) should be:
- Save the deployment diagram.
- Select the deployment diagram in the Organizer and open the Targeting Expert from the Generate menu.
- Choose the integration: Threaded Integrations->Win32 threaded.
- You will be prompted if you want to generate the sdl_cfg.h file. Select No!
- Disable the Generation of Environment Function by deselecting Environment Functions in the Environment section of the window.
- Click on the Compiler/Linker/Make line in the Partitioning Diagram Model. You should now see the following in the Targeting Expert window, see:: The Compile/Linker/Make Window in Targeting Expert.
- Define the following flag: THREADED_SIMPLE_EXAMPLE in the Compiler description/Options window. This flag will start the External threads in the simple example.
- Define the following Compilation flags:
- Add the MyExtTask.c file as a new source file.
- You should now be back in the Analyze/Generate code window and be ready to generate the application.
- Run the application simple.sct. Please note that you have to traverse down in the generated directory structure to find the application.
The output you should see when you run the application should be as follows:
http://www.ibm.com/rational |
![]() |
![]() |
![]() |
![]() |