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 ...


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.
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...
Thanks a lot.
Matthieu



-----Message d'origine-----
De: Andrew Lunn [mailto:andrew.lunn@ascom.ch]
Date: lundi 28 juillet 2003 17:38
À: Matthieu.GIRARDIN@fr.thalesgroup.com
Cc: ecos-discuss@sources.redhat.com
Objet: Re: [ECOS] Mutex, queue ...


On Mon, Jul 28, 2003 at 05:29:18PM +0200,
Matthieu.GIRARDIN@fr.thalesgroup.com wrote:
> Excuse me but I have only one problem for you today...
> 
> I'm trying to use the cyg_mutex functions. I created a mutex with
> cyg_protocol_none (I don't remember the exact name but the meaning is the
> same; I'm on another computer...) and I test in what order functions are
> free.
> I have a problem always with the two first one.
> For exemple functions block on the mutex as : 1 then 2 then 3 ... 4 5 6
and
> they are free as : 2 then 1 then 3 ... 4 5 6.
> So I don't understand why... 

Do you mean that the order threads are unblocked from a cyg_mutex_lock
is not the same as the order they are blocked.

Correct. Nothing in the documentation says they should be.

In fact, the default is for the thread with the highest priority to be
unblocked first. 

          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


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