* [Xenomai-help] --posix-ldflags and rt_task_shadow() of main
@ 2009-04-30 10:10 Frederik Bayart
2009-04-30 12:12 ` Gilles Chanteperdrix
0 siblings, 1 reply; 2+ messages in thread
From: Frederik Bayart @ 2009-04-30 10:10 UTC (permalink / raw)
To: xenomai
Hallo,
I have a following question :
I have an executable linked linked with
xeno-config --posix-ldflags
so depends on :
libpthread_rt.so.1
If I want to turn my main function into a realtime task with
rt_task_shadow like code sample below, EBUSY is returned and I get the
message :
rt_task_shadow() failed: Device or resource busy.
This would mean that my main task is already a realtime task and I don't
have to call rt_task_shadow anymore. Is this correct ? It seems very
strange to me and I didn't find any documentation which confirms that if
you link with posix-flags your main thread is automatically realtime.
I don't get this message if I link with the xeno-config --xeno-ldflags,
but the reason that I want to link with the posix flags is that I also
use the shm_open function in my binary.
Below a code sample.
Frederik
int main()
{
mlockall(MCL_CURRENT | MCL_FUTURE);
if ((err = rt_task_shadow(&this_task, "Model:" QUOTE(MODEL), 1, T_FPU))
!= 0)
printf("rt_task_shadow() failed: %s.\n", strerror(-err));
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Xenomai-help] --posix-ldflags and rt_task_shadow() of main
2009-04-30 10:10 [Xenomai-help] --posix-ldflags and rt_task_shadow() of main Frederik Bayart
@ 2009-04-30 12:12 ` Gilles Chanteperdrix
0 siblings, 0 replies; 2+ messages in thread
From: Gilles Chanteperdrix @ 2009-04-30 12:12 UTC (permalink / raw)
To: Frederik Bayart; +Cc: xenomai
Frederik Bayart wrote:
> Hallo,
>
> I have a following question :
>
> I have an executable linked linked with
> xeno-config --posix-ldflags
>
> so depends on :
> libpthread_rt.so.1
>
> If I want to turn my main function into a realtime task with
> rt_task_shadow like code sample below, EBUSY is returned and I get the
> message :
>
> rt_task_shadow() failed: Device or resource busy.
>
> This would mean that my main task is already a realtime task and I don't
> have to call rt_task_shadow anymore. Is this correct ? It seems very
> strange to me and I didn't find any documentation which confirms that if
> you link with posix-flags your main thread is automatically realtime.
>
> I don't get this message if I link with the xeno-config --xeno-ldflags,
> but the reason that I want to link with the posix flags is that I also
> use the shm_open function in my binary.
You are correct, the main thread is automatically shadowed by the POSIX
skin library. This makes things much more consistent, and simplifies the
user experience: an applications using the POSIX API continues to
compile and to work without further changes with Xenomai posix skin,
automatically using Xenomai posix skin services when they exist.
You can disable this behaviour with the configure --enable-dlopen option.
Note that POSIX skin shared memory services are only useful to share
memory between kernel and user-space using the posix API. If you want to
share memory between user-space real-time applications, you can simply
use the libc shared memory services.
--
Gilles.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-04-30 12:12 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-30 10:10 [Xenomai-help] --posix-ldflags and rt_task_shadow() of main Frederik Bayart
2009-04-30 12:12 ` Gilles Chanteperdrix
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.