Task running Time

Hi all,

I have a problem with tasks switching

for example I have created three tasks in priority based pre-emption the highest priority task will run when it goes to suspended state or when it compleates scheduling switches to the next high priority task, but i want that the running task to be suspended and scheduling switches to the next high priority ready task after some defined time let us say 100ms. Then next task is to run for some time let us say

50ms then it has to give scheduling to the next ready high priority task

summary of problem

In Priority based Pre-emption

1st high priority ready task runs for 100ms then it suspends 2nd high priority ready task runs for 50ms then it suspends 3rd high priority ready task runs for 200ms then it suspends

this above senario has to be continue for ever

please give me some suggestions how to implement this.

NOTE: I am using VxWorks RTOS

Regards Saidulu.E snipped-for-privacy@gmail.com

Reply to
Loading thread data ...

Does VxWorks support dynamic task priority assignments?

You could use a timer interrupt, which would have a higer priority than the tasks and then elevate the priority of the one that you want to run.

You could also probably work something out with a task sleep function.

owever, what you are trying to do, though, sounds like you are defeating part of the purpose of the RTOS and attempting to use a round-robin like scheduler instead. There are problems associated with this type of scheduling which is why one uses a pre-emptive priority based scheduler in the first place.

If you approach the code from a different perspective you can probably achieve better performance. Try to find ways to use the various priority levels available to you to your advantage as opposed to making everything equal and time slicing it.

Reply to

When I was working on automotive RTOSes we found that a lot of OEMs had to include an RTOS (typically an OSEK) in their systems to get through the manufacturers' door with their products, but the mix of inertia, NIH syndrome, and unfamiliarity with RTOS concepts meant that they were still designing cyclic schedulers, complete with all manner of gruesome major/minor cycles in them.


pete@fenelon.com "That is enigmatic. That is textbook enigmatic..." - Dr Who
                 "There's no room for enigmas in built-up areas." - N Blackwell
Reply to
Pete Fenelon

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.