From: Philippe Gerum <rpm@xenomai.org>
To: "M. Koehrer" <mathias_koehrer@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Scheduler: Strange priority handling
Date: Mon, 14 May 2007 14:17:56 +0200 [thread overview]
Message-ID: <1179145077.5045.98.camel@domain.hid> (raw)
In-Reply-To: <9958525.1179143870179.JavaMail.ngmail@domain.hid>
On Mon, 2007-05-14 at 13:57 +0200, M. Koehrer wrote:
> HI all,
>
> thanks for all the responses.
> Using mutexes instead of semaphores actually solves the issue.
> However, the API documentation of rt_sem_create() is a little bit confusing here.
> The "mode" parameter of rt_sem_create() may contain "S_PRIO" which
> "makes tasks pend in priority order on the semaphore".
> I interpret this that it works actually the very same as with mutexes.
No, absolutely not. Please reread the detailed explanations. This is
_not_ a matter of priority management wrt sema4, but the ability for the
nucleus to steal the resource depending on the respective priority of
_threads_ that want to consume it. S_PRIO is about setting the sema4
behaviour when it comes to enqueue pending threads for _sleeping_ on a
resource; this has nothing to do with how a running thread might steal a
sema4 resource from another one due to its priority being higher
combined to the fact that the current owner of the resource did not wake
up yet in the meantime.
> However, it
> is implemented that sem_v directly triggers a waiting task (even if it is low prio).
> As the semaphore has nothing to do with the scheduler, this makes sense.
> However, this cannot be found within the API documentation.
The sema4 does have something to do with the scheduler: it calls its
services to operate on the thread runstates. But there is nothing else
to document, aside of "semaphores do work as expected", in this case.
>
> Regards
>
> Mathias
>
--
Philippe.
prev parent reply other threads:[~2007-05-14 12:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-14 8:40 [Xenomai-help] Scheduler: Strange priority handling with multiple tasks waiting for one semaphore M. Koehrer
2007-05-14 9:42 ` Dmitry Adamushko
2007-05-14 9:45 ` Jan Kiszka
2007-05-14 10:00 ` Philippe Gerum
2007-05-14 11:57 ` [Xenomai-help] Scheduler: Strange priority handling M. Koehrer
2007-05-14 12:14 ` Dmitry Adamushko
2007-05-14 12:17 ` Philippe Gerum [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1179145077.5045.98.camel@domain.hid \
--to=rpm@xenomai.org \
--cc=mathias_koehrer@domain.hid \
--cc=xenomai@xenomai.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.