Thread Executions

Moderators: TomKerekes, dynomotion

Post Reply
PBandJacob
Posts: 21
Joined: Thu Sep 02, 2021 6:02 pm

Thread Executions

Post by PBandJacob » Thu Feb 10, 2022 8:05 pm

Hello!
Is there a C program equivalent of the script command CheckThread<N>?
Is the size of the .out file proportional to the number of threads a program will occupy? If I have a 150 KB .out file, will it occupy three user threads and have a timing of 360us (90 us for Thread 0, 90 us for Thread 1, 90 us for Thread 2, and 90 us for Thread 3) or will it act as if it only occupies 1 thread and have an execution timing of 180 us? (90 us for Thread 0, 90 us for Thread 1)?

User avatar
TomKerekes
Posts: 2527
Joined: Mon Dec 04, 2017 1:49 am

Re: Thread Executions

Post by TomKerekes » Thu Feb 10, 2022 10:24 pm

Hi,
Is there a C program equivalent of the script command CheckThread<N>?
The ThreadActive variable has bits 0-7 for which Threads are active. 1=Active 0=Inactive.

Code: Select all

extern volatile int ThreadActive;  // one bit for each thread    
Is the size of the .out file proportional to the number of threads a program will occupy?
No. Compile in KMotion.exe and it will report the size.
If I have a 150 KB .out file, will it occupy three user threads and have a timing of 360us (90 us for Thread 0, 90 us for Thread 1, 90 us for Thread 2, and 90 us for Thread 3) or will it act as if it only occupies 1 thread and have an execution timing of 180 us? (90 us for Thread 0, 90 us for Thread 1)?
If a Thread's memory overflows into another Thread's memory it is still 1 Thread and in that case would still be 90us for Thread 0 and 90us for Thread 1.

HTH
Regards,

Tom Kerekes
Dynomotion, Inc.

Post Reply