This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Mutex, queue ...


Matthieu.GIRARDIN@fr.thalesgroup.com writes:

> is it the only rule : the highest priority thread is unblocked first ?
> i agree with that but for the others ?
> I tried to block 6 tasks on a mutex :
> task 4 with priority 14
> task 5 with priority 10
> task 6 with priority 12
> task 7 with priority 11
> task 8 with priority 13
> task 9 with priority 15
> With the option "kernel -> scheduler -> priority -> Unblock Oldest First",
> they are unblocked following this order :
> task 5 : ok it's the highest priority
> task 4 then task 6 then 7 then 8 then 9.

It is possible that the threads are actually being put on to the queue
in the order you see them coming off it. Thread 5 will, of course,
preempt any of the others, and will therefore hit the mutex first. So
you may just be falling victim to any prioritization that happens
before the threads try to lock the mutex.

> I need to ensure that tasks are free in FIFO or by priority. I mean I might
> free this tasks as:
> in FIFO : 4,5,6,7,8,9
> in priority order : 5,7,6,8,4,9
> Can I do this with the eCos functions ?
> If I can't, do someone have any idea...

You can always turn on the sorted queues option and get prioritized
queueing.

If you still think there is a problem, put together a *simple* test
program that exhibits the symptoms and I'll take a look at it. 

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com      The eCos and RedBoot experts


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]