Author Topic: Resource and Time Management for RTOS  (Read 1286 times)

0 Members and 1 Guest are viewing this topic.

Offline BlogRahulTopic starter

  • Regular Contributor
  • *
  • Posts: 75
  • Country: in
Resource and Time Management for RTOS
« on: October 12, 2021, 05:57:02 am »
Hi

I read that different tasks share resources in real time application. I don't understand exactly what resource are and how they are shared ? Is MCU peripheral called a resource?

 

 
 

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3464
  • Country: it
Re: Resource and Time Management for RTOS
« Reply #1 on: October 12, 2021, 06:53:03 am »
 

Offline BlogRahulTopic starter

  • Regular Contributor
  • *
  • Posts: 75
  • Country: in
Re: Resource and Time Management for RTOS
« Reply #2 on: October 12, 2021, 08:23:46 am »
is this the same as https://www.microchip.com/forums/m1187480.aspx ?
No, I am not asking for PIC microcontroller. 
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9891
  • Country: us
Re: Resource and Time Management for RTOS
« Reply #3 on: October 12, 2021, 09:07:41 am »
Hi

I read that different tasks share resources in real time application. I don't understand exactly what resource are and how they are shared ? Is MCU peripheral called a resource?

Anything that is shared between two or more tasks could be considered a resource.  One example is a counter that is incremented in an interrupt service routine and tested in some non-interrupt function.  Under some conditions, you need to prevent an interrupt while manipulating the variable in the non-interrupt function.

A queue is another example.  Data may be put into the queue during an interrupt process and extracted during a non-interrupt process.  Or, data could be put into the queue by the non-interrupt function and extracted and sent to the UART by an interrupt function.  The head and tail pointers require special handling so that the addresses don't get tangled up.

Hardware resources (peripherals) aren't necessarily shared resources.  Usually only one function deals with a peripheral.

Memory can be a shared resource.  Perhaps as a result of some DMA function...

« Last Edit: October 12, 2021, 09:12:36 am by rstofer »
 

Offline MarginallyStable

  • Regular Contributor
  • *
  • Posts: 67
  • Country: us
Re: Resource and Time Management for RTOS
« Reply #4 on: October 12, 2021, 05:34:08 pm »
The most obvious one is the cpu/mpu itself is a resource. The RTOS time manages execution of multiple tasks.
 

Offline SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14521
  • Country: fr
Re: Resource and Time Management for RTOS
« Reply #5 on: October 12, 2021, 05:55:22 pm »
Well, that's one of those catch-all terms.
A resource used by a task is just anything a task can use while running. A shared resource, you guessed it, is this anything that several tasks could be using instead of just one.
Examples are many. Memory, peripherals, CPU core...
Now before caring about how 'resources' are shared, you may want to start with knowing what tasks are, in what context...
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 4204
  • Country: us
Re: Resource and Time Management for RTOS
« Reply #6 on: October 12, 2021, 06:20:17 pm »
Quote
Hardware resources (peripherals) aren't necessarily shared resources.  Usually only one function deals with a peripheral.
One can easily share an I2C or Ethernet Interface/peripheral.Or a "pool" of timers.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf