Page 1 of 1

OS_Skip(how_many_times, _Label) new service

PostPosted: Tue Nov 05, 2002 8:58 am
by luben

As you remember I had one old idea about "compassion" of high priority tasks to the low priority tasks. If one task has too high priority it will "eat" the time of low priority tasks. The idea, or let's say - the "ideal" RTOS should bring time to all tasks, just like they are running on absolutely different and independent processors. Well, the reality is, that all RTOS are far away from this point.

My idea is how to bring some "gulp" of processor time to very low priority tasks.

I got and idea for some new service:
OS_Skip(how_many_times, _Label)
It's equal to the OS_Delay() with the exception that it counts how many times was accessed the OSSched - not the OSTimer.

So, if one very high priority task calls
OS_Skip(4, _Label)
it will:
- contex switch to kernel
- will bring 4 times the "right to run" to other tasks in the queue, thus allowing lower priority task to take control.

Just an idea.

BTW, I never had real need for such service, it's amazing that even with 6 or 8 tasks the processors runs smooth with SALVO.

In my last project for controlling 8 digital potenciometers and 4x20 LCD, auto save changes in EEPROM, long menus, etc. I found for the first time that sometimes, when typing too fast the keyboard, some disturbances of the smoot operation occured ( due to the increasing the activity in all tasks). I solved the problem with adding some "buffer" variables, but maybe if there was such service and I was experienced with it, I could use it...

Best regards

Re: OS_Skip(how_many_times, _Label) new service

PostPosted: Tue Nov 05, 2002 9:36 am
by aek
Interesting ...

Keep in mind that right now you can change task priorities with OS_SetPrio() and OSSetPrioTask().


Re: OS_Skip(how_many_times, _Label) new service

PostPosted: Wed Nov 06, 2002 9:08 am
by luben

To be more exectly - you can not garantee that if one high priority task lower its priority can go back in determined time ot its previous status.

I mean - if the high priority task goes to the level of lower priority tasks, it's not determined when it can receive again the control to higher the priority. If the low priority tasks "lost their patient" and have to do a lot of job - the high priority task have to wait and wait.

My idea is to put clear criteria how long the task will stay "away" and to garantee that after some time it will be back on its place. Of course if you play with prioritirs even now you can do this job... but extreme care should be taken to avoid big "undesirable vacations" of the high priority task.

It's simple and I suppose, easy to implement idea - the high priority task exectly knows how long could stay away from the program flow.

Even you can increase the power of the new service by simply adding the feature - if no other task "wants" to take control (all are waiting, delayed, destroyed and stopped) the high priority task could take back immediately the control and not to wait _how_many_times to call OSSched. I mean, it brings the possibility for other tasks to take the control, but if nobody wants it - it takes back the "donation"...
it's logical.. if you want to make donation and nobody want to take the money - fo course, you put the money back in your pocket - it's human behaviour.

More of the idea in the programming were took from the human sociaty.... this service exectly describes the charity and donation side in our society - when rich people bring money and attention to poor beggers and homeless.


Re: OS_Skip(how_many_times, _Label) new service

PostPosted: Wed Nov 06, 2002 12:46 pm
by luben

Priority change is not always desirable. When one very high priority task lost its priority it could never run again. It's just like you lose all your money and job.. it's not sure that you'll come back to your current status. In my case it looks like short vacation... the task looks "poor, without money", but after several OSSched() runs it returns back its worth...

Maybe we should change the name to
OS_Vacation(_days,_OFFICE) ..... huh?


[This message has been edited by luben (edited November 06, 2002).]

Re: OS_Skip(how_many_times, _Label) new service

PostPosted: Wed Jul 08, 2009 11:55 am
by tbims23822 is a premium website for cheap air jordans shoes and other more really nike air jordan shoes.We have varity of cheap air jordan shoes available for wholesale.Cheap China wholesale shoes including cheap Nike shoes and cheap jordan shoes,nike sneakers,nike sneakers discount,air jordan sneakers,air force sneakers.We supply nike sneakers,jordan sneakers,air jordan sneakers,air force sneakers wholesale.You can buy very cheap jordans shoes including cheap women shoes,cheap nike shoes,cheap running shoes from us.