From: Paul Ruizendaal <pnr@planet.nl>
To: TUHS main list <tuhs@minnie.tuhs.org>
Subject: [TUHS] v3 pipes
Date: Sat, 25 Apr 2020 13:14:15 +0200 [thread overview]
Message-ID: <430B2F35-D250-499E-83F9-58D4C1764CE0@planet.nl> (raw)
[-- Attachment #1: Type: text/plain, Size: 1017 bytes --]
>> why the single fd approach was abandoned? To its credit, it appears to allow for limited 2-way communication.
> My understanding is that the single file descriptor broke the open-file
> model, which had a single read/write pointer. Two-way communication via
I’m not sure I understand.
In the implementation, the read pointer is file location offset (“fp->f_offset”) and the write pointer is the file size (“ip->i_size”). The location offset on the writing end of the pipe is always zero, and on the reading end it moves between zero and PIPSIZ (but that is unobservable).
I just tried making both pipe ends readable+writeable in my “V6.5” kernel and that appears to work. It allows for bi-directional communication in a half-duplex sense (i.e communicating walky-talky style). The other benefit is using just one file descriptor, at a time when a process had just 15 to work with.
Maybe the issue was that two sides writing to a full pipe at the same time will cause deadlock?
[-- Attachment #2: Type: text/html, Size: 1818 bytes --]
next reply other threads:[~2020-04-25 11:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-25 11:14 Paul Ruizendaal [this message]
2020-04-25 17:54 ` Paul Winalski
-- strict thread matches above, loose matches on Subject: below --
2020-04-24 12:54 Doug McIlroy
2020-04-23 13:48 [TUHS] V3 pipes Paul Ruizendaal
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=430B2F35-D250-499E-83F9-58D4C1764CE0@planet.nl \
--to=pnr@planet.nl \
--cc=tuhs@minnie.tuhs.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 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).