From: dave@horsfall.org (Dave Horsfall)
Subject: [TUHS] EOF on pipes?
Date: Tue, 27 Feb 2018 16:48:38 +1100 (EST) [thread overview]
Message-ID: <alpine.BSF.2.21.1802271638180.20297@aneurin.horsfall.org> (raw)
In-Reply-To: <CAMYpm87ugxnUne3pwxhdt3YYiLP+i5FgqyQytHoVKgKizuVW+w@mail.gmail.com>
On Tue, 27 Feb 2018, Rudi Blom wrote:
> By using pipe() you create a FIFO pipe with certain limitations
> (including 5120 write limit). When you open the streams device twice and
> ioctl() two file descriptors together you have more flexibility.
There's always been a limit on the write until the reader got around to
it; that's why you had to take care to avoid deadlocks.
Heck, I fell into a deadlock the other day with Perl; I thought that "say
<$reader_pipe>" (to echo whatever was read) as a neat shortcut would
work... It deadlocked, because "<>" was evaluated in list context
(because of "say") and hence waited for the EOF that would never arrive so
that I could close the writer end.
--
Dave Horsfall DTM (VK2KFU) "Those who don't understand security will suffer."
next prev parent reply other threads:[~2018-02-27 5:48 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-27 5:04 Rudi Blom
2018-02-27 5:48 ` Dave Horsfall [this message]
-- strict thread matches above, loose matches on Subject: below --
2018-02-25 13:07 Doug McIlroy
2018-02-25 13:16 ` George Michaelson
2018-02-25 13:56 ` arnold
2018-02-25 0:53 Norman Wilson
2018-02-25 16:29 ` Paul Winalski
2018-02-25 22:25 ` Lyndon Nerenberg
2018-02-25 23:18 ` Bakul Shah
2018-02-26 2:39 ` Grant Taylor
2018-02-24 21:33 Dave Horsfall
2018-02-24 23:13 ` Ron Natalie
2018-02-24 23:42 ` Bakul Shah
2018-02-24 23:46 ` Nelson H. F. Beebe
2018-02-24 23:46 ` Jon Steinhart
2018-02-26 16:03 ` Rudi Blom
2018-02-26 16:58 ` Ian Zimmerman
2018-02-26 17:19 ` Larry McVoy
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=alpine.BSF.2.21.1802271638180.20297@aneurin.horsfall.org \
--to=dave@horsfall.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).