9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Charles Forsyth <charles.forsyth@gmail.com>
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] read9pmsg usage
Date: Mon, 10 Aug 2015 21:33:13 +0100	[thread overview]
Message-ID: <CAOw7k5jAFWHM5uWWsKTMu7=GVeP+e+GAMObx_dbhzczrqTOe2w@mail.gmail.com> (raw)
In-Reply-To: <CAHL7psFzRmO8F0infkzxd8_xfteFok9PL0pS0QJ1b6cbdtgjOw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 976 bytes --]

On 10 August 2015 at 21:17, Giacomo Tesio <giacomo@tesio.it> wrote:

> Zero can either mean EOF or "I'm alive but boring".
>
>
I can't see how a reliable communication (a cpu connection for example) can
> survive this mismatch.
> I'm probably missing something.
>

A specialised reader and writer can always agree that it means something
else in a particular case,
but the general convention is that zero (empty record) means you've hit the
end of a sequence of records (if write boundaries are preserved)
or the end of a sequence of bytes (if write boundaries are not preserved),
and thus end of file.
In other words, the interpretation is the traditional one from UNIX and
other systems.

It isn't intended as a general "keep-alive" mechanism. That's why the
read9pmsg case is odd,
and why I think the comment and code are wrong.

You could for instance use it to send several distinct byte streams through
a pipe, but only to a specialised reader.

[-- Attachment #2: Type: text/html, Size: 1820 bytes --]

  reply	other threads:[~2015-08-10 20:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-10 14:11 Giacomo Tesio
2015-08-10 14:22 ` erik quanstrom
2015-08-10 14:35   ` Giacomo Tesio
2015-08-10 14:54     ` Charles Forsyth
2015-08-10 15:40       ` Charles Forsyth
2015-08-10 20:17       ` Giacomo Tesio
2015-08-10 20:33         ` Charles Forsyth [this message]
2015-08-11 15:48 ` Charles Forsyth
2015-08-12  0:21   ` Giacomo Tesio
2015-08-12  7:25     ` David du Colombier
2015-08-12  9:18       ` Giacomo Tesio
2015-08-12 17:17         ` Charles Forsyth

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='CAOw7k5jAFWHM5uWWsKTMu7=GVeP+e+GAMObx_dbhzczrqTOe2w@mail.gmail.com' \
    --to=charles.forsyth@gmail.com \
    --cc=9fans@9fans.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).