From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: xenomai@xenomai.org
Subject: Re: Antwort: Re: [Xenomai-core] Questions about pSOS task mode and task priority
Date: Mon, 29 Jan 2007 14:25:44 +0100 [thread overview]
Message-ID: <45BDF5D8.4020607@domain.hid> (raw)
In-Reply-To: <1169832375.3346.67.camel@domain.hid>
Philippe Gerum wrote:
> On Fri, 2007-01-26 at 18:16 +0100, Thomas Necker wrote:
>
>>Hi Philippe
>>
>>
>>>>non-preemptive mode.
>>>>With original pSOS this was allowed and "non-preemptive" meant that a
>>>>runnable task cannot be preempted by other tasks but can block itself.
>>>>Why is this different in Xenomai and is it possible to implement the
>>
>>same
>>
>>>>behaviour in Xenomai core?
>>>>
>>>
>>>Xenomai implements the non-preemptible mode as most RTOSes implement
>>>scheduling locks. From this POV, allowing a non-preemptible task to
>>>block makes no sense, and doing so usually either locks up the board, or
>>>causes an API error.
>>>
>>>It could be possible to switch the preemption bit on before entering a
>>>blocking state only for pSOS tasks, then reinstate it when the task
>>>wakes up, though. However, before going down that path, is there any
>>>pSOS documentation that clearly states that such behaviour is to be
>>>expected (i.e. that blocking calls _may_ be called in non-preemptible
>>>mode)?
>>>
>>>Or did you benefit from an undocumented and fortunate side-effect of the
>>>pSOS implementation when relying on such behaviour?
>>
>>Since Markus has already left, I had a quick look in the pSOS System
>>Concepts Manual:
>>
>> Each task has a mode word, with two settable bits that can affect
>>scheduling.
>> One bit controls the task's preemptibility. If disabled, then once the
>>task
>> enters the running state, it will stay running even if other tasks
>> of higher priority enter the ready state. A task switch will occur
>>only if
>> the running task blocks, or if it re-enables preemption.
>>
>>So it clearly states that a non-preemtible task may block (and
>>rescheduling occurs in
>>this case).
>
>
> Ok, so this is a must fix. Will do. Thanks for reporting.
I had a look at the OSEK specification, it also has non-preemptible
tasks. So, I guess we should add an xnpod_locked_schedule that simply does
if (xnthread_test_state(xnpod_current_sched()->runthread, XNLOCK)) {
xnpod_unlock_sched();
xnpod_lock_sched();
} else
xnpod_schedule();
and call this xnpod_locked_schedule() instead of xnpod_schedule() in
these skins.
--
Gilles Chanteperdrix
next prev parent reply other threads:[~2007-01-29 13:25 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-26 17:16 Antwort: Re: [Xenomai-core] Questions about pSOS task mode and task priority Thomas Necker
2007-01-26 17:26 ` Philippe Gerum
2007-01-29 13:25 ` Gilles Chanteperdrix [this message]
2007-01-29 14:53 ` Philippe Gerum
2007-01-30 7:49 ` [Xenomai-core] Xenomai Bits on MIPS somshekar kadam
2007-01-30 9:21 ` Jan Kiszka
2007-01-31 0:40 ` Antwort: Re: [Xenomai-core] Questions about pSOS task mode and task priority Philippe Gerum
2007-01-31 8:55 ` Gilles Chanteperdrix
2007-01-31 9:10 ` Philippe Gerum
2007-01-31 9:28 ` Gilles Chanteperdrix
2007-01-31 10:24 ` Philippe Gerum
2007-01-31 10:26 ` Jan Kiszka
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=45BDF5D8.4020607@domain.hid \
--to=gilles.chanteperdrix@xenomai.org \
--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.