All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
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: Wed, 21 Jan 2009 10:53:27 +0000	[thread overview]
Message-ID: <4976FEA7.5010707@domain.hid> (raw)
In-Reply-To: <5D63919D95F87E4D9D34FF7748CE2C2A01776901@domain.hid>

roderik.wildenburg@domain.hid wrote:
>> It is not your job to decide the priority of a xenomai thread when
>> it runs in secondary mode, you have to set the xenomai scheduler's
>> priority of the thread, and xenomai itself will change the priority
>> for linux scheduler. The way to do this is to call
>> pthread_setschedparam in the "linuxwithxenolib" process.
> 
> You would be right if I would design a new process, but
> "linuxwithxenolib" is an existing (Linux) process which is just
> linked with my Xenomai-library and should be influenced as few as
> possible by my library (this process still should act as an
> prioritzed Linux process as far as possible). This process, and
> several others, are spawned by "sysup" and "sysup" sets the priority
> and the scheduling policy (to SCHED_FIFO) of the spawned processes.
> This is an existing mechanism (!) and could not changed easily, as it
> would have backlash to many other processes (and people -whose
> Xenomai skills are poor- developing these processes, ). Additional to
> these ordinary Linux processes we have several pure
> Xenomai-processes, which of course, use pthread_setschedparam to set
> their scheduling parameters. These pure Xenomai-processes are also
> using my Xenomai-library.
> 
> From this scenario deduce the following questions :
> 
> 1.) Linking a linux-process with a Xenomai-library "transforms" the
> linux process to a Xenomai-process/task. Is this true ?

Yes, and you need this to be able to call Xenomai services.

For your issue, we could probably use the existing process priority
instead of forcing SCHED_OTHER, 0. But for this to work, we have to be
sure that the "sysup" process does not call sched_setscheduler too late
after the creation of the process, IOW, there is a race condition.

But I still do not understand why you can not handle this in the xenomai
library. For instance by passing the priority to an initialization
function. You would avoid the race.

> 
> 2.) Is there a way to influence the priority and scheduling policy of
> a Xenomai-task from outside the task (from an other task (like
> "sysup"); like sched_setscheduler can do for linux processes) ?

No.

> 
> 3.) As soon as a Xenomai-systemcall (e.g. clock_gettime, sem_post,
> sem_wait) is executed in this process the process is scheduled in
> primary mode ?

For some services, yes, for others no. You can find the information in
the online documentation.

> 
> 4.) Is there a way, to force back a process to secondary mode (after
> the Xenomai-systemcall has been executed) ?

Yes, but no, you do not want to do that. Xenomai automatically switches
the process when needed.

> 
> Thank you for your patience and endurance in understanding my problem
> (my english probabliy isn´t very helpfull for this).
> 
> Roderik


-- 
                                                 Gilles.



  reply	other threads:[~2009-01-21 10:53 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 [this message]
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
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=4976FEA7.5010707@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --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.