From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to verify LabVIEW RT Round Robin Schedule

I am trying to understand and verify the behavior of the LabVIEW RT scheduler on a multi core CPU.
In this example, I have simplified the problem by using cRIO-9074 that has a single logical CPU.
(Under the hood, the cRIO-9074 target runs LabVIEW RT on the VxWorks RTOS).


I am trying to verify that within one execution system, parallel clones of a single VI are executed in a round robin schedule, because the VI clones should each have the same priority.

 

Please see the attached code.

 

The Sub VI: ‘Other 1 Loop Wait 0’ contains a sequence structure. In the first frame of the sequence structure a ‘Wait until next millisecond multiple’ is called. This should synchronize the parallel instances of the VI’s. The second frame of the sequence structure then contains a while loop with a Wait 0 inside. The Wait 0 operation yields VI (thread) execution back to the scheduler, whilst signaling that the VI (thread) is ready to run again.
Execution of the while loop continues until the set ‘Execution Time’ has elapsed. If the LabVIEW RT scheduler executes each VI (thread?) in a round robin schedule, I expect each instance of the Sub VI to execute the same number of while loop iterations (within one).
Unfortunately, I cannot verify the behavior which is inconsistent and unpredictable.

 

When the Execution Time (input control) is set to 5 milliseconds or less, each while loop executes the same number of iterations, as expected. But when the execution time is set to more than 5 milliseconds, the while loops execute a different number of times, and the outcome is not repeatable. For example: when Execution Time is set to 100ms, the loop iteration counts are 30158, 39113 and 20457; then: 32515, 21646, 21512; then: 21515, 32429, 21725; etc. It seems that the Sub VI clones (threads) are not executed in a round robin schedule.

 

Please can you help to explain the behavior, which could effect my real application.
Is it there any way to achieve the expected behavior of round robin execution?

Download All
0 Kudos
Message 1 of 1
(486 Views)