ROSSIER Daniel wrote:
> >-----Original Message-----
> >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> >On Behalf Of Gilles Chanteperdrix
> >Sent: mardi 30 octobre 2007 14:30
> >To: Patrick
> >Cc: [email protected]
> >Subject: Re: [Xenomai-help] RT, nonRT communication
> >
> >On 10/30/07, Patrick <[EMAIL PROTECTED]> wrote:
> >> > -----Message d'origine-----
> >> > De: Gilles Chanteperdrix [mailto:[EMAIL PROTECTED]
> >> > Envoyé: mardi, 30. octobre 2007 10:52
> >> > À: Patrick
> >> > Cc: [email protected]
> >> > Objet: Re: [Xenomai-help] TR: RT, nonRT communication
> >> >
> >> > On 10/30/07, Patrick <[EMAIL PROTECTED]> 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.
_______________________________________________
Xenomai-help mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-help