All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gilles Chanteperdrix <gilles.chanteperdrix@xenomai.org>
To: ROSSIER Daniel <Daniel.Rossier@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] RT, nonRT communication
Date: Wed, 31 Oct 2007 09:43:30 +0100	[thread overview]
Message-ID: <18216.16434.853914.993008@domain.hid> (raw)
In-Reply-To: <FDBBB5CC70676540B3EF7CFE83FD94E0E30519@domain.hid>

ROSSIER Daniel wrote:
 > >-----Original Message-----
 > >From: xenomai-help-bounces@domain.hid [mailto:xenomai-help-bounces@domain.hid]
 > >On Behalf Of Gilles Chanteperdrix
 > >Sent: mardi 30 octobre 2007 14:30
 > >To: Patrick
 > >Cc: xenomai@xenomai.org
 > >Subject: Re: [Xenomai-help] RT, nonRT communication
 > >
 > >On 10/30/07, Patrick <kpa_info@domain.hid> wrote:
 > >> > -----Message d'origine-----
 > >> > De: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
 > >> > Envoyé: mardi, 30. octobre 2007 10:52
 > >> > À: Patrick
 > >> > Cc: xenomai@xenomai.org
 > >> > Objet: Re: [Xenomai-help] TR: RT, nonRT communication
 > >> >
 > >> > On 10/30/07, Patrick <kpa_info@domain.hid> wrote:
 > >> > >
 > >> > >
 > >> > >
 > >> > >
 > >> > > Hi,
 > >> > >
 > >> > >
 > >> > >
 > >> > > Is it possible to share a pthread_mutex between a rt task and a
 > >linux
 > >> > > pthread ?
 > >> >
 > >> > No, it is not possible
 > >> >
 > >> > >
 > >> > > My two tasks must share resources and I must protect them against
 > >> > concurrent
 > >> > > access.
 > >> > >
 > >> > > If pthread_mutex is not the correct way to do it can you tell me
 > >how to
 > >> > > achieve this ?
 > >> >
 > >> > The way to handle these border line cases is to make your linux
 > >> > pthread a xenomai thread running with the SCHED_OTHER scheduling
 > >> > policy. Note that the main thread already has this property.
 > >> >
 > >> Ok, so if I understand I can't use a pthread_mutex between the main
 > >thread
 > >> and a rt_task ?
 > >
 > >You CAN use a xenomai pthread_mutex between the main thread and a
 > >rt_task, the main thread is a xenomai thread running with the
 > >SCHED_OTHER scheduling policy.
 > >
 > 
 > I guess there is a misunderstanding of "main thread" here. The main thread should actually not be a xenomai thread since it belongs to a non-RT application. Patrick is actually using the Qt framework on a PXA device which of course is not a RT-domain application. The thing is that the Qt application should somehow retrieve some data issued from RT-application. Currently the Qt application is starting a Xenomai thread - by doing an extern "c" invokation from Qt - and the data list is shared between the main (qt-)thread (non-RT) and the Xenomai thread; that's why Patrick wanted to use a mutex. But indeed, as far as I know, it will be not possible to do that since the waiting queues on sync objects as mutex are managed differently (dealing with linux threads on the one hand, with Xenomai threads on the other hand) between the RT and non-RT domains. So the question would be: how can data be exchanged in a safe way between a non-RT domain and a RT-domain?

As soon as you compile your application with the flags returned by
xeno-config --posix-cflags and xeno-config --posix-ldflags, it really
becomes an RT application where all threads are real-time threads. The
only way to create a non real-time thread in such an application is by
calling __real_pthread_create.

-- 


					    Gilles Chanteperdrix.


  reply	other threads:[~2007-10-31  8:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-30 12:03 [Xenomai-help] RT, nonRT communication Patrick
2007-10-30 13:29 ` Gilles Chanteperdrix
2007-10-31  7:37   ` ROSSIER Daniel
2007-10-31  8:43     ` Gilles Chanteperdrix [this message]
2007-11-01 10:04       ` Patrick
2007-11-01 11:14         ` Patrick
2007-11-01 11:23           ` Jan Kiszka
2007-11-01 12:33             ` Patrick
2007-11-01 15:46               ` Patrick
2007-11-01 16:02                 ` Gilles Chanteperdrix
2007-11-12 14:00             ` Patrick
2007-11-12 15:48               ` Gilles Chanteperdrix
2007-11-12 21:20               ` Jan Kiszka
2007-11-01 15:46         ` Gilles Chanteperdrix
2007-11-10 11:25       ` Patrick
2007-11-10 12:24         ` Gilles Chanteperdrix
2007-10-31  9:39     ` Daniel Schnell
  -- strict thread matches above, loose matches on Subject: below --
2007-11-13  7:37 Patrick

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=18216.16434.853914.993008@domain.hid \
    --to=gilles.chanteperdrix@xenomai.org \
    --cc=Daniel.Rossier@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.