From: Thien-Thi Nguyen <ttn@gnuvola.org>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Bindings for ‘sendfile’
Date: Sun, 14 Apr 2013 12:48:40 +0200 [thread overview]
Message-ID: <87ip3p1j7b.fsf@zigzag.favinet> (raw)
In-Reply-To: <87d2u2bp93.fsf@tines.lan> (Mark H. Weaver's message of "Wed, 10 Apr 2013 07:26:32 -0400")
[-- Attachment #1: Type: text/plain, Size: 2107 bytes --]
() Mark H Weaver <mhw@netris.org>
() Wed, 10 Apr 2013 07:26:32 -0400
Regarding the proposed low-level interface (which I will call
'sendfile-some' for now), I have a question: can it actually be used
to write a robust asynchronous server?
I can't imagine why not, although i certainly don't pretend to be an
expert on async server programming. My experience is mostly on the
client side, w/ Emacs as the front-end. I would be surprised if
sendfile(2) is NOT used in robust asynchronous servers written in C.
Is it guaranteed to never block for more than a short time? I don't
know the answer.
Me neither, although i think this depends on ‘O_NONBLOCK’, which is
established on open(2).
If the answer is "no", then it seems to me that this would eliminate
the most compelling reason for a 'sendfile-some' API.
Why?
Or how about the other potential use case you gave: to keep stats on
how much is sent per "chunk". What is the meaning of "chunk"? If
so, is sendfile(2) guaranteed to return once for each chunk? If not,
then what is the meaning of the statistics you would gather?
I'd rather not get into particulars in this line of discussion, if you
don't mind, for lack of time. Instead, i'll just ask you to try to
imagine a robust P2P architecture (every node as both client and server)
that does NOT care about flow control, and spew some philosophy here
(feel free to ignore)...
My reading of sendfile(2) is that it does its best to send as much as
possible, but does not guarantee sending everything. What it does
succeed in sending, it reports to the caller. The caller loops as
desired, after evaluating (in some caller-meaningful way) the returned
information.
All i desire is the semantics of a Scheme ‘sendfile’ not deviate from
that of the syscall sendfile(2); i judge not "implication of the name
for the statistical majority", only fidelity, when it comes to syscalls.
Control, not coddling, please -- why should C programmers have all the fun?
--
Thien-Thi Nguyen
GPG key: 4C807502
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2013-04-14 10:48 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-20 22:21 [PATCH] Bindings for ‘sendfile’ Ludovic Courtès
2013-03-21 0:17 ` Noah Lavine
2013-03-21 9:15 ` Ludovic Courtès
2013-03-21 10:04 ` Andrew Gaylard
2013-03-21 15:39 ` Noah Lavine
2013-03-21 3:45 ` Nala Ginrut
2013-03-21 4:50 ` Mark H Weaver
2013-03-21 5:24 ` Mark H Weaver
2013-03-21 9:40 ` Ludovic Courtès
2013-03-21 9:49 ` Andy Wingo
2013-03-21 10:10 ` Ludovic Courtès
2013-03-22 19:22 ` Mark H Weaver
2013-03-22 21:27 ` Ludovic Courtès
2013-03-24 5:04 ` Mark H Weaver
2013-03-25 12:55 ` Ludovic Courtès
2013-04-07 19:53 ` Ludovic Courtès
2013-04-09 8:33 ` Thien-Thi Nguyen
2013-04-09 15:02 ` Ludovic Courtès
2013-04-09 20:34 ` Thien-Thi Nguyen
2013-04-10 11:26 ` Mark H Weaver
2013-04-14 10:48 ` Thien-Thi Nguyen [this message]
2013-04-16 16:31 ` Ludovic Courtès
2013-04-16 20:14 ` Thien-Thi Nguyen
2013-04-17 12:52 ` Ludovic Courtès
2013-04-17 15:18 ` Thien-Thi Nguyen
2013-04-17 16:27 ` Ludovic Courtès
2013-04-18 6:58 ` Thien-Thi Nguyen
2013-04-10 20:56 ` Ludovic Courtès
2013-04-14 10:52 ` Thien-Thi Nguyen
2013-04-07 21:51 ` Ludovic Courtès
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
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ip3p1j7b.fsf@zigzag.favinet \
--to=ttn@gnuvola.org \
--cc=guile-devel@gnu.org \
--cc=mhw@netris.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 read-only IMAP folder(s) and NNTP newsgroup(s).