I have a question about thread timing.
and...
When this thread is added and its timeslice is 10 msec, how often does the thread run? Is there a complete gap in the main loop for 10 msec when nothing happens?
How often does the cpu "switch over" and run the added thread? And if it does, does it stay there for 10 msec?
And of course the main runs exactly 1,010,000 micro seconds.
So that is the main question, what does the 10 msec signify? The time spent per second? How often is the thread called?
Does it do 1000 instructions on the main, and then 10 on the thread? Or spend 1 msec on the main and then work 0.01 msec on the thread?
Thanks.
Code:
volatile uint counter;
void threadFunction()
{
while(1)
{
counter++;
threads.delay (1000);
}
}
and...
Code:
void loop()
{
delay(1000);
}
When this thread is added and its timeslice is 10 msec, how often does the thread run? Is there a complete gap in the main loop for 10 msec when nothing happens?
How often does the cpu "switch over" and run the added thread? And if it does, does it stay there for 10 msec?
And of course the main runs exactly 1,010,000 micro seconds.
So that is the main question, what does the 10 msec signify? The time spent per second? How often is the thread called?
Does it do 1000 instructions on the main, and then 10 on the thread? Or spend 1 msec on the main and then work 0.01 msec on the thread?
Thanks.
Last edited: