Author Topic: RTOS timing  (Read 1928 times)

0 Members and 1 Guest are viewing this topic.

Offline gogomanTopic starter

  • Regular Contributor
  • *
  • Posts: 116
RTOS timing
« on: June 30, 2017, 04:21:42 am »
Hi new to this subject, forgive the obvious.

In a multi thread application where thread 1 is called every 30us (highest priority, 3us completion), thread 2 called every 100us,  500us to complete , and thread 3 called  every 1 ms 100us to complete.
A general  explanation would be helpful.

btw The processor clk is 100 mhz,
thanks

 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1672
  • Country: us
Re: RTOS timing
« Reply #1 on: June 30, 2017, 04:31:54 am »
Well, thread 2 is a problem because it's getting called every 100us, but it takes 500us to complete. What exactly are you looking for here?
Complexity is the number-one enemy of high-quality code.
 

Offline Brianf

  • Regular Contributor
  • *
  • Posts: 73
  • Country: gb
Re: RTOS timing
« Reply #2 on: June 30, 2017, 06:14:26 am »
What overhead does your RTOS have when thread switching?
How much jitter can you tolerate on your thread's start times?
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: RTOS timing
« Reply #3 on: June 30, 2017, 07:26:38 am »
Google for "Rate Monotonic Analysis" and study the basics.
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1530
  • Country: gb
Re: RTOS timing
« Reply #4 on: June 30, 2017, 08:30:01 am »
Quote
In a multi thread application where thread 1 is called every 30us (highest priority, 3us completion), thread 2 called every 100us,  500us to complete , and thread 3 called  every 1 ms 100us to complete.
A general  explanation would be helpful.
I do no think that is how RTOS scheduling works.

Generally, RTOS task scheduling is pre-emptive round robin with priorities.
That means every task is given the same length of time slot to run before the next one is scheduled in.
There is a level based priority system, the highest priority tasks get scheduled before the lower ones.
All task run until suspension or completion or they get put back on the suspended task list waiting for their next time slot.

The scheduler in some RTOS can be set to run in co-operative mode, that is tasks run until suspension or completion and then the next task is scheduled.
Again, this can be done with task priorities.

Hope this helps.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: RTOS timing
« Reply #5 on: June 30, 2017, 12:48:21 pm »
Hi new to this subject, forgive the obvious.

In a multi thread application where thread 1 is called every 30us (highest priority, 3us completion), thread 2 called every 100us,  500us to complete , and thread 3 called  every 1 ms 100us to complete.
A general  explanation would be helpful.

btw The processor clk is 100 mhz,
thanks

You haven't actually asked us a question, what exactly do you want to know?
 
The following users thanked this post: gogoman

Offline gogomanTopic starter

  • Regular Contributor
  • *
  • Posts: 116
Re: RTOS timing
« Reply #6 on: July 06, 2017, 05:22:26 am »

thanks for the info.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf