We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi all,
I am using RTX in LPC2148, I am using 3 tasks with different priority. I want to run the tasks periodically like task_1 run for every 10ms,task_2 runs for every 20ms and the third one for every 50ms. Is this possible to run a task concurrently means i want to how to configure it. I try the below method
__task void task_1(void) { os_itv_set(10); while(1) { os_itv_wait();
/* my code goes here*/ }
}
same procedure i followed for remaining tasks, but i am not get what i am expected. Is there is any other ways are available in RTX.
Thanks in advance
The OS performs task switching - i.e. it switches which task that runs at any one time. That's all your processor can manage. And that was all PC machines could manage too, until we got processors with multiple cores or with hyperthreading.
And that was why I created a diagram that indicated that when both a high-prio and low-prio task wants to run at the same time, then the low-prio task will have to wait.
The concurrency you get is through short time-slices where the processor jumps between the available threads or switches to the background "idle" thread if none of your threads wants to be serviced.
This isn't a limitation of the operating system, but a limitation of the processor hardware. True concurrency requires that the processor has multiple program counters and can use them to pick up and execute multiple instructions concurrently. This level of functionality exists in PC machines and in newer mobile phones. But most microcontrollers are much smaller than that.