SMP Sample
Description
This program spawns 3 threads in a suspended state. It then assigns a processor to run each thread using a round-robin technique. Each thread kicks off and starts stating a unique statement for each iteration, continuing until the first thread signals completion. Upon completion, the main thread shuts down all the threads, commences cleanup, and shuts down the program.
Source Files
| File | Description |
|---|---|
| SMPSample.ertos |
The main source file. |
Building the Sample
- Open a project file in the corresponding Visual Studio version you use for development.
- Build the project.
Running the Sample
To run the sample:
- Boot the system in its Windows Boot Configuration.
- Navigate to
<InstallDrive>\MaxRT\eRTOS\. - Right-click AutoStart.bat and select Edit.
- Write the Run command(s) for SMP.
Note: For more information on Run commands, see Run.
- Re-boot the system from a GRUB bootable USB drive or hard drive.
- Select the desired GRUB boot configuration. See GRUB Boot Configurations for more information.
- Upon system boot, the sample(s) will run automatically after the eRTOS Kernel startup.
- Sample output will be displayed on the screen when the program ends.
- Re-boot the system in its Windows Boot Configuration.
- Navigate to
<InstallDrive>\MaxRT\eRTOS\. - Open the RtLogFile.txt log file to view sample output.
Remarks
You must have two or more cores assigned to eRTOS in order for this sample to demonstrate the use of multiple cores for either side. No arguments are needed to run this sample.
APIs Referenced