* [Xenomai-help] Problem using sem_open and rt_sem_create
@ 2009-01-29 6:27 Daniel Adams
2009-01-29 6:38 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Adams @ 2009-01-29 6:27 UTC (permalink / raw)
To: xenomai
[-- Attachment #1: Type: text/plain, Size: 1033 bytes --]
Hi *,
I'm fairly new to Xenomai and am having a few issues and was wondering if
anyone could provide me with help
I have written some code to create a process which waits on a named
semaphore and then there is another process which posts to it. I originally
developed the code using the posix interface under a standard Linux
environment and have proved it works.
I have since ported the code so that the waiting half creates and waits on
the semaphore using the native skin and the posting half uses the posix
skin.
I tried naming the semaphore using the leading '/' as the posix standard
suggests, but found that using the '/' causes the rt_sem_create(&rt_sem,
SEM_NAME, 0, S_PULSE) to return EINVAL. Removing the '/' allows the
semaphore to be created but now when I try to open the semaphore
with sem_open(SEM_NAME, O_EXCL), I get an error that the file doesn't exist.
Is there something that I'm missing? I've check the registry and the
semaphore appears under /proc/xenomai/registry/native/semaphores/.
Thanks,
Dan Adams
[-- Attachment #2: Type: text/html, Size: 1133 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Problem using sem_open and rt_sem_create
2009-01-29 6:27 [Xenomai-help] Problem using sem_open and rt_sem_create Daniel Adams
@ 2009-01-29 6:38 ` Gilles Chanteperdrix
2009-01-29 6:46 ` Daniel Adams
0 siblings, 1 reply; 4+ messages in thread
From: Gilles Chanteperdrix @ 2009-01-29 6:38 UTC (permalink / raw)
To: Daniel Adams; +Cc: xenomai
Daniel Adams wrote:
> Hi *,
>
> I'm fairly new to Xenomai and am having a few issues and was wondering if
> anyone could provide me with help
>
> I have written some code to create a process which waits on a named
> semaphore and then there is another process which posts to it. I originally
> developed the code using the posix interface under a standard Linux
> environment and have proved it works.
> I have since ported the code so that the waiting half creates and waits on
> the semaphore using the native skin and the posting half uses the posix
> skin.
>
> I tried naming the semaphore using the leading '/' as the posix standard
> suggests, but found that using the '/' causes the rt_sem_create(&rt_sem,
> SEM_NAME, 0, S_PULSE) to return EINVAL. Removing the '/' allows the
> semaphore to be created but now when I try to open the semaphore
> with sem_open(SEM_NAME, O_EXCL), I get an error that the file doesn't exist.
> Is there something that I'm missing? I've check the registry and the
> semaphore appears under /proc/xenomai/registry/native/semaphores/.
The objects created by the two skins are completely separate.
--
Gilles.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Problem using sem_open and rt_sem_create
2009-01-29 6:38 ` Gilles Chanteperdrix
@ 2009-01-29 6:46 ` Daniel Adams
2009-01-29 7:13 ` Gilles Chanteperdrix
0 siblings, 1 reply; 4+ messages in thread
From: Daniel Adams @ 2009-01-29 6:46 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai
[-- Attachment #1: Type: text/plain, Size: 1688 bytes --]
Thanks Gillies,
Is it possible to use the rt_sem_bind from a linux process that hasn't been
shadowed using rt_task_shadow?
Is this the same for named pipes created using the native skin and accessing
them from a posix interface?
What is the recommended IPC to talk between posix threads and native rt
threads?
Thanks again for your help.
On Thu, Jan 29, 2009 at 3:38 PM, Gilles Chanteperdrix <
gilles.chanteperdrix@xenomai.org> wrote:
> Daniel Adams wrote:
> > Hi *,
> >
> > I'm fairly new to Xenomai and am having a few issues and was wondering if
> > anyone could provide me with help
> >
> > I have written some code to create a process which waits on a named
> > semaphore and then there is another process which posts to it. I
> originally
> > developed the code using the posix interface under a standard Linux
> > environment and have proved it works.
> > I have since ported the code so that the waiting half creates and waits
> on
> > the semaphore using the native skin and the posting half uses the posix
> > skin.
> >
> > I tried naming the semaphore using the leading '/' as the posix standard
> > suggests, but found that using the '/' causes the rt_sem_create(&rt_sem,
> > SEM_NAME, 0, S_PULSE) to return EINVAL. Removing the '/' allows the
> > semaphore to be created but now when I try to open the semaphore
> > with sem_open(SEM_NAME, O_EXCL), I get an error that the file doesn't
> exist.
> > Is there something that I'm missing? I've check the registry and the
> > semaphore appears under /proc/xenomai/registry/native/semaphores/.
>
> The objects created by the two skins are completely separate.
>
> --
> Gilles.
>
[-- Attachment #2: Type: text/html, Size: 2356 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Xenomai-help] Problem using sem_open and rt_sem_create
2009-01-29 6:46 ` Daniel Adams
@ 2009-01-29 7:13 ` Gilles Chanteperdrix
0 siblings, 0 replies; 4+ messages in thread
From: Gilles Chanteperdrix @ 2009-01-29 7:13 UTC (permalink / raw)
To: Daniel Adams; +Cc: xenomai
Daniel Adams wrote:
> Thanks Gillies,
>
> Is it possible to use the rt_sem_bind from a linux process that hasn't been
> shadowed using rt_task_shadow?
No. If you read the documentation of rt_sem_bind, you will see:
Environments:
This service can be called from:
* User-space task (switches to primary mode)
And to switch to primary mode, task needs to be shadowed with
rt_task_shadow.
> Is this the same for named pipes created using the native skin and accessing
> them from a posix interface?
The non real-time side of named pipes may be accessed using the Linux
posix interface, not Xenomai posix skin interface.
>
> What is the recommended IPC to talk between posix threads and native rt
> threads?
It depends if you are talking about (non real-time) Linux posix threads,
or (real-time) Xenomai posix skin threads.
If you are talking about Linux posix threads, then what you are looking
for is rt_pipes.
If you are talking about Xenomai posix skin threads, then mostly any IPC
of both skins may be used. Only, you have to use the same interface with
both skins. So, for instance, if you choose Xenomai posix skin message
queues, you have to use mq_open, mq_send, mq_receive, mq_close,
mq_unlink with the threads of the two skins.
--
Gilles.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-01-29 7:13 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-29 6:27 [Xenomai-help] Problem using sem_open and rt_sem_create Daniel Adams
2009-01-29 6:38 ` Gilles Chanteperdrix
2009-01-29 6:46 ` Daniel Adams
2009-01-29 7:13 ` 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.