This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: round-robin behaviour of MLQ wrt particular priority level
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: sandeep <shimple0 at yahoo dot com>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 27 Oct 2004 11:06:29 +0100
- Subject: Re: [ECOS] round-robin behaviour of MLQ wrt particular priority level
- References: <417E8304.8030801@yahoo.com>
sandeep <shimple0@yahoo.com> writes:
> I was following -
>
> wake (thread.cxx)
> -> add_thread (mlqueue.cxx)
> --> add_tail (Cyg_CList, clist.hxx)
> ---> insert (Cyg_DNode, clist.hxx)
>
> shouldn't add_tail call append instead of insert??
> insert adds new node at the beginning of the list, and in next
> schedule() call get_head() will return the head element from list
> (Cyg_RunQueue). this means the newer thread added to runqueue at a
> particular priority level will be given chance first (making it
> LIFO). MLQ is roundrobin wrt a particular priority level.
Remember that these are circular lists with the list object itself
pointing to the head node. The last node in the list is pointed to by
the prev field of the head node. So to add a node to the tail of the
list, it simply needs to be insert()ed as the head node's
predecessor.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com/ The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss