My application wants to run a periodic task at a period of 200 microseconds (timing a bit TBD, but faster than 1 ms). One option could be to lower the system tick of ThreadX to something lower than the default 10 milliseconds, say 100 microseconds. However, I’ve read that this could incur potentially significant overhead in the RTOS. Though I’m wondering if this overhead may/may not matter depending on CPU speed? Beyond increasing the system tick, what options do I have? Some options I’m considering, but haven’t found documentation that explicitly supports it.
-
Could I configure “Application Timers” to run faster than the system tick? Or are Application Timers tied to ThreadX system tick?
-
Could a timer peripheral interrupt be setup on the microcontroller to execute at the desired rate? If we setup a timer peripheral to trigger an interrupt every 200 microseconds and had a thread suspended on a queue or semaphore (
tx_queue_receive
ortx_semaphore_get
). Could I calltx_queue_send
ortx_sempahore_put
in the ISR in order to unblock that thread? What I couldn’t find/confirm is whether or not upon exiting that ISR, the scheduler and in turn, the now ready thread will immediately execute? Or if the thread will still have to wait till the next system tick to run?- This post says “If a high priority interrupt makes another higher priority thread ready, ThreadX will record the new thread as next thread to execute, but it will not call the scheduler directly. Instead, it sets the PendSV interrupt to pending state.” Which makes me think the thread might execute immediately after the ISR? But I’m not sure.
-
Other options?