This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TM4C123GH6PM: Ti-RTOS task switch rate

Part Number: TM4C123GH6PM

Is there a service in TI-RTOS that allow calculating task context switching rate per seconds?

Thanks,

Mohammed

  • Hi,

      I'm not aware of such service that calculates the task context switching rate per second. First bear in mind that the RTOS default tick is 1ms. Normally the RTOS will context switch every time a new task gets a chance to run. This means that switch to a new task can only happen at every OS tick and only if there are multiple tasks that are ready to run at the same priority level of the currently running task. It also has to happen any time the current task blocks to wait for a queue, semaphore, does a delay, etc.

      In Chapter 8 of the video training for TI-RTOS https://www.ti.com/video/series/getting-started-ti-rtos.html, you can learn about UIA (Unified Instrumentation Architecture) and System Analyzer to have some visibility into the runtime status such as Task Load, CPU Load and etc. 

      

  • Are you saying that the scheduler will wait until the next tick to perform the context switch even if the task is being ready in the middle of the tick like that task that will be trigegred by interrupt?

  • An interrupt will not wait for the tick. I was explaining more for context switching between tasks. Interrupt is asynchronous and will be handled right away. 

  • I Understand that the interrupt will be served immediatly, but I'm asking about the task. what if the task was pending on a semaphore that will be fired by the interrupt and the task has the heighest priority. so this mean that the task shall be executed first thing. my question is when the task will be started after finishing the ISR? is it after first tick or after finishing the ISR immediatly?

  • Yes, it will return to the highest priority task immediately after the ISR is exited since it is a event that you post in the ISR for the pending task to unblock.