From: Philippe Gerum <rpm@xenomai.org>
To: "Ignacio García Pérez" <iggarpe@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Strange pipe behaviour
Date: Wed, 16 Nov 2005 12:45:25 +0100 [thread overview]
Message-ID: <437B1BD5.4060206@domain.hid> (raw)
In-Reply-To: <437AE37D.8010304@domain.hid>
Ignacio García Pérez wrote:
>>>1- rt_pipe_receive returns with r >= 0.
>>>2- /* whatever */
>>>3- Message is freed using rt_pipe_free.
>>>4- Next call to rt_pipe_receive returns with r = -EINTR.
>>>
>>>The only explanation I could come up with is that when the pipe is
>>>closed by the user mode process, the rt_pipe_receive tells the rt task
>>>by returning -EINTR. Is this right?.
>>
>>
>>Yes.
>>
>> According to the docs, -EINTR is
>>
>>
>>>only returned if rt_task_unblock() has been called...
>>>
>>
>>Actually, this is what happened through the internal interface.
>>driver::release(pipe) -> nucleus::unblock(sleepers_on_pipe)
>
>
> Sure, but that behaviour is *extremely* confusing for a newbie (like
> me). Should be described in the docs (this time I don't submit a patch
> because I don't quite understand the pipe internals yet).
>
If you understand enough of the API documentation to disagree with it, I guess
that you should be able to reword it in a way that seems less error-prone in
your eyes. You don't have to explain the gory details of the implementation to
do that.
> And anyway, I don't see the point in notifying the RT task that the
> non-RT end has closed the pipe.
Message pipes are connection-oriented thingies. You cannot just let one
communication end-point vanish and leave the other side lingering indefinitely
without notifying it.
Or, in other words, if we want to
> provide such a notification, we should provide also opening notification.
>
That's irrelevant. rt_pipe_connect() from kernel space is semantically similar
to open(some_named_fifo,O_RDWR|O_NONBLOCK) from user-space, since the caller
does not wait for the other end-point to show up. But even in that case, closing
the named fifo at the other side causes any subsequent read() on the connecting
side to be notified of the closure. The same goes for message pipes. The only
thing you could argue is that read() would first return a zero-sized message
first as an end-of-file marker, then an error upon all subsequent reads; since
we don't want to forcibly close the kernel side upon user-space closure, a
possible change would be to make rt_pipe_recv() return -EPIPE instead of -EINTR
in that specific case.
And actually, the nucleus interface does provide support for registering a
connection notification handler, but it is not exported by the native skin since
it would buy us nothing in the context of a regular API.
> By the way, where is the xnpipe_* API documentation? I could not find it
> in the online docs (firefox downloads the file search.php when I try to
> use the search feature).
>
Still undocumented portion.
>
>>>Nacho.
>>>
>>>
>>>
>>>
>>>_______________________________________________
>>>Xenomai-help mailing list
>>>Xenomai-help@domain.hid
>>>https://mail.gna.org/listinfo/xenomai-help
>>>
>>
>>
>
>
--
Philippe.
next prev parent reply other threads:[~2005-11-16 11:45 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-10 21:05 [Xenomai-help] Creation of a rt-queue from the user space ROSSIER Daniel
2005-11-11 9:30 ` [Xenomai-help] printk Ignacio García Pérez
2005-11-11 11:07 ` Dmitry Adamushko
2005-11-14 10:52 ` Ignacio García Pérez
2005-11-14 11:26 ` Philippe Gerum
2005-11-14 12:03 ` Dmitry Adamushko
2005-11-14 13:22 ` Philippe Gerum
2005-11-14 13:47 ` Philippe Gerum
2005-11-14 14:50 ` [Xenomai-core] " Dmitry Adamushko
2005-11-14 15:56 ` [Xenomai-core] rt_pipe_* usage Ignacio García Pérez
2005-11-14 16:15 ` [Xenomai-core] More on rt pipes usage Ignacio García Pérez
2005-11-15 13:24 ` Philippe Gerum
2005-11-15 16:41 ` [Xenomai-help] " Ignacio García Pérez
2005-11-14 16:23 ` [Xenomai-core] rt_pipe_* usage Dmitry Adamushko
2005-11-14 16:36 ` Ignacio García Pérez
2005-11-15 12:41 ` [Xenomai-core] Web site error (API doc search) Ignacio García Pérez
2005-11-15 13:16 ` [Xenomai-core] rt_pipe_* usage Philippe Gerum
2005-11-15 16:22 ` Ignacio García Pérez
2005-11-16 5:38 ` Philippe Gerum
2005-11-15 9:38 ` [Xenomai-core] Re: [Xenomai-help] printk Philippe Gerum
2005-11-15 10:00 ` Dmitry Adamushko
2005-11-16 12:58 ` Philippe Gerum
2005-11-16 14:44 ` Dmitry Adamushko
2005-11-17 9:44 ` [Xenomai-help] Blocking reads from pipes Ignacio García Pérez
2005-11-17 10:21 ` Romain Lenglet
2005-11-17 13:16 ` Ignacio García Pérez
2005-11-17 15:11 ` Dmitry Adamushko
2005-11-17 17:24 ` Gilles Chanteperdrix
2005-11-17 17:55 ` [Xenomai-core] " Dmitry Adamushko
2005-11-17 19:17 ` Gilles Chanteperdrix
2005-11-17 19:45 ` Dmitry Adamushko
2005-11-18 8:57 ` Ignacio García Pérez
2005-11-18 9:10 ` Dmitry Adamushko
2005-11-17 19:40 ` Dmitry Adamushko
2005-11-17 10:46 ` Dmitry Adamushko
2005-11-14 12:15 ` [Xenomai-help] xn_pipe_create [minor] Ignacio García Pérez
2005-11-14 13:53 ` Dmitry Adamushko
2005-11-14 16:28 ` Ignacio García Pérez
2005-11-14 16:29 ` Philippe Gerum
2005-11-14 16:41 ` Ignacio García Pérez
2005-11-14 16:52 ` Dmitry Adamushko
2005-11-14 17:38 ` Philippe Gerum
2005-11-14 18:33 ` Dmitry Adamushko
2005-11-15 8:04 ` Philippe Gerum
2005-11-14 18:03 ` [Xenomai-help] Strange pipe behaviour Ignacio García Pérez
2005-11-16 5:45 ` Philippe Gerum
2005-11-16 7:45 ` Ignacio García Pérez
2005-11-16 11:45 ` Philippe Gerum [this message]
2005-11-14 16:40 ` [Xenomai-help] xn_pipe_create [minor] Dmitry Adamushko
2005-11-12 19:45 ` [Xenomai-help] printk Philippe Gerum
2005-11-14 10:47 ` [Xenomai-help] Invalid characters in task's names Ignacio García Pérez
2005-11-14 11:39 ` Philippe Gerum
2005-11-11 14:08 ` [Xenomai-help] Creation of a rt-queue from the user space Jan Kiszka
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=437B1BD5.4060206@domain.hid \
--to=rpm@xenomai.org \
--cc=iggarpe@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.