Thread scheduling configuration

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

Thread scheduling configuration

Postby Guillaume227 » Sat Apr 16, 2022 5:17 am

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: Thread scheduling configuration

Postby Giovanni » Sat Apr 16, 2022 6:46 am

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


Return to “ChibiOS/RT”

Who is online

Users browsing this forum: No registered users and 2 guests