Thread scheduling configuration

Discussions and support about ChibiOS/RT, the free embedded RTOS.
Post Reply
Guillaume227
Posts: 15
Joined: Tue Apr 18, 2017 6:52 pm
Has thanked: 10 times

Thread scheduling configuration

Post 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 ?
User avatar
Giovanni
Site Admin
Posts: 14891
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: Thread scheduling configuration

Post 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
Post Reply