[ECOS] Why to signal condvar with mutex held?

sandeep shimple0@yahoo.com
Tue Dec 14 12:58:00 GMT 2004


> > what about keeping the waitlists sorted in decreasing priority order of
> > threads, when you go with idea of wait morphing? won't this ensure that
> > highest priority waiting thread gets the mutex?
> 
> As far as I know, priority (as opposed to FIFO) wait queues is a
> separate configuration option in eCos, so you can have them even now if
yup. there is CYGIMP_KERNEL_SCHED_SORTED_QUEUES in scheduler.cdl that is
disabled by default (not much varied configuration from default, i have
explored, as controlled by needs), but the description of that is slightly off.

display goes as "Dequeue oldest threads first"

that doesn't say anything about priority, but gives the impression about
possible choice of LIFO/FIFO order. this needs to be changed to reflect the
priority stuff. Andrew/JLD, any plans for that?

and descriptions says -
  "With this option enabled, threads queued in a thread queue
   will be dequeued in priority order, rather than last in,
   first out (LIFO). Threads of equal priority are dequeued
   oldest first. The only exception is the scheduler run
   queues where order is less important as each is already
   sorted by priority. Note that this makes the thread queueing
   less deterministic."

description talks about the priority, but mentions default as LIFO. i haven't
explored corresponding code yet, so no idea if it is LIFO or FIFO as you
mentioned.

> you wish. However, it's not always a good idea to have priority wait
> queues as it makes it possible for low priority thread waiting in a
> queue to never get executed. In addition, enqueue into the sorted queue
> in eCos is slower.
that suggestion was because of some concern of Nick involving high priority vs.
low priority thread in wait morphing. and yes, that had problems, as mentioned
with that.

if wait morphing is implemented as a configurable option and Nick's concern is
catered to (not bothering about possible problems as you also mentioned), then
wait morphing could be made as requiring sorted queue.

thanks for providing company apart from maintainers.

sandeep


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list