All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: roderik.wildenburg@domain.hid
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] How to use Xenomai libraries with "normal" (non Xenomai) linux processes ?
Date: Thu, 22 Jan 2009 13:34:41 +0100	[thread overview]
Message-ID: <497867E1.8080006@domain.hid> (raw)
In-Reply-To: <5D63919D95F87E4D9D34FF7748CE2C2A01776CCD@ARVMAIL1.mra.roland-man.biz>

roderik.wildenburg@domain.hid wrote:
> Jan Kiszka wrote:
> 
>>> The point is that if you force it to secondary mode, and 
>> the next system
>>> call is in fact a xenomai syscall, xenomai will switch the thread to
>>> primary mode again. So, you have two useless mode switches which you
>>> could have avoided if you had not forcibly switched to 
>> secondary mode.
>>> Note that even if a xenomai thread is running in secondary 
>> mode and has
>>> a priority higher than another xenomai thread running in 
>> primary mode,
>>> the one running in secondary mode will run. So, you should not use
>>> primary mode and secondary mode to decide which thread 
>> should run, you
>>> should use the priorities.
>> The only imaginable scenario for having to force some thread back to
>> secondary mode is when that thread is running significant CPU load
>> _without_ issuing a single regular syscall. If such a thread enters
>> primary mode and is then left there, Linux will not be able to run
>> anymore. In that case one may insert a tiny nanosleep etc. to enforce
>> the switch. But that's still a fairly theoretic scenario.
>>
> 
> But nanosleep is a Xenomai function. So, after that nanosleep the
> process would return to pimary mode and run in front of all other
> Xenomai tasks (a high priority provided) although it has been just an
> oridnary Linux task (which has been linked with a Xenomai library) and
> therefore should only run when all Xenomai processes yield CPU. Am I
> right? Do you understand my dilemma ?

Yeah, bad example. Take $YOUR_FAVORITE_CHEAP_LINUX_SYSCALL instead, for
instance syscall(SYS_pid) will be better.

Jan

-- 
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux


  reply	other threads:[~2009-01-22 12:34 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4975EAF5.2000604@domain.hid>
2009-01-21  9:53 ` [Xenomai-help] How to use Xenomai libraries with "normal" (non Xenomai) linux processes ? roderik.wildenburg
2009-01-21 10:53   ` Gilles Chanteperdrix
2009-01-21 12:27     ` roderik.wildenburg
2009-01-21 13:05       ` Gilles Chanteperdrix
2009-01-21 13:36         ` Jan Kiszka
2009-01-22 12:22           ` roderik.wildenburg
2009-01-22 12:34             ` Jan Kiszka [this message]
2009-01-22 11:06         ` roderik.wildenburg
2009-01-22 13:14           ` Gilles Chanteperdrix
2009-01-22 14:25             ` roderik.wildenburg
2009-01-22 14:33               ` Gilles Chanteperdrix
2009-01-22 13:42           ` Gilles Chanteperdrix
2009-01-20 13:16 roderik.wildenburg
2009-01-20 13:20 ` Gilles Chanteperdrix

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=497867E1.8080006@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=roderik.wildenburg@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.