This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Round robin scheduler question
- From: Andrew Lunn <andrew dot lunn at ascom dot ch>
- To: Ian Gilmour <ian dot gilmour at ffei dot co dot uk>
- Cc: "Ecos-Discuss (E-mail)" <ecos-discuss at sources dot redhat dot com>
- Date: Wed, 20 Aug 2003 15:17:52 +0200
- Subject: Re: [ECOS] Round robin scheduler question
- References: <334D05460466D311A5E8009027AC788603880A85@hhmail1.hh.ffei.co.uk>
> So any clues as to what I have to change for option 2?
I think i would try something like:
mlqueue.c: function schedule(void) At the end
#else
register cyg_uint32 index;
HAL_LSBIT_INDEX(index, queue_map);
Cyg_RunQueue *queue = &run_queue[index];
CYG_ASSERT( !queue->empty(), "Queue for index empty");
Cyg_Thread *thread = queue->get_head();
+ if ( thread != current) {
+ cyg_priority pri = current->priority;
+ Cyg_Scheduler *sched = &Cyg_Scheduler::scheduler;
+ Cyg_RunQueue *current_queue = &sched->run_queue[pri];
+ current_queue->rotate();
+ }
#endif
This is totally untested. Make sure you turn on asserts and expect it
to go horribly wrong!
Andrew
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss