Page 1 of 1

Thread scheduling configuration

Posted: Sat Apr 16, 2022 5:17 am
by Guillaume227
Ciao Giovanni,

I would like to understand more about your comment in that thread where you advised on thread scheduling:
viewtopic.php?t=5408#p37219

Code: Select all

#define CH_CFG_ST_FREQUENCY                 10000 -> 1000 (10000 is too high without tick-less mode)
#define CH_CFG_ST_TIMEDELTA                 2 -> 0 (disables tick-less mode)
#define CH_CFG_TIME_QUANTUM                 0 ->> 10 (rotation after 10 ticks)


Why is 10000 too high without tick-less mode? Is that an absolute truth or is it going to be MCU dependent, e.g. the faster the MCU the higher that number can be?
I am curious what an optimal configuration of CH_CFG_ST_FREQUENCY and CH_CFG_TIME_QUANTUM would be.
I am sure optimal is hard to define exactly and might depend on a particular application - however there might be some rules of thumb for best performance ?

Re: Thread scheduling configuration

Posted: Sat Apr 16, 2022 6:46 am
by Giovanni
Hi,

It depends on your application, 10000 means that you are serving 10000 interrupts per seconds which is doable but not necessarily a good idea.

There are no optimal values, it depends on your requirements about system time resolution and round robin interval. Our defaults before we implemented the tick-less mode were 1000 and 20.

Giovanni