From: Nala Ginrut <nalaginrut@gmail.com>
To: Mark H Weaver <mhw@netris.org>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: [PATCH] Add current-suspendable-io-status parameter
Date: Tue, 14 May 2019 12:22:24 +0800 [thread overview]
Message-ID: <CAPjoZofSHzpvWnkC0Y8x=Sa-060XFTYZbWu90SzJuNPoVQ200A@mail.gmail.com> (raw)
In-Reply-To: <87lfzaj6ya.fsf@netris.org>
Hi Mark!
Thanks for so patient reply!
On Tue, May 14, 2019 at 7:01 AM Mark H Weaver <mhw@netris.org> wrote:
> I guess what you want is the ability to see incremental reports on the
> progress of your large I/O operations. Is that right? If we are going
> to add an API for this, it needs to be reliable, and always give reports
> in terms of the high-level requests that the user gave.
Yes, that's exactly what I want. We need to get the progress of I/O
operation when it's blocking
so that we can compute a fair priority for the tasks.
> My preferred approach would be something like this: we could add a
> 'put-bytevector-some' I/O primitive which writes some bytes from a
> bytevector, blocking only as needed to write at least one byte. It
> would return the number of bytes written. This can be used to implement
> an efficient variant of 'put-bytevector' that gives you access to the
> real-time progress information.
I'm not sure if put-bytevector-some does the work, I'll list my concerns:
1. All I/O will be managed by Guile when we enabled suspendable-port.
That is to say, from the users side, users never know their I/O
operations are blocking or not. It's transparent to users.
Guile will guarantee the I/O operations to be finished by managing all
the blocking I/O mechanisms.
Users can only interact with the task with read or write waiter, which
are registered by users themselves.
In this scenario, users are out of control of I/O operations. And they
have no way to get the progress of I/O, since there's
no way to pass this status to the waiter function except for
parameters in my patch.
2. suspendable-port module has already provided a bunch of overridden
bytevector-* functions.
However, they're hidden from users. I think it's good since the
purpose of suspendable-port is to abstract all these details from
users. Users only consider the read-waiter and write-waiter for scheduling.
If we provide the low-level bytevector functions to users to let them
do the non-blocking I/O by themselves, just like most C framework
does. Then Guile suspendable-port will lose a critical feature,
although users can still implement asynchronous non-blocking I/O by
themselves with a non-managed approach. Say, do the I/O, check result
by themselves, and do the scheduling.
Personally, I'm fine with this way, since I'm familiar with both ways.
But managed I/O of suspendable-port is a good selling point for many
inexperienced server-side developers, they can use it in Scheme just
like IOCP or AIO.
Of course, I may misunderstand your mind.
Could you elaborate more about your approach?
Best regards.
next prev parent reply other threads:[~2019-05-14 4:22 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-13 10:54 [PATCH] Add current-suspendable-io-status parameter Nala Ginrut
2019-05-13 10:56 ` Nala Ginrut
2019-05-13 20:54 ` Mark H Weaver
2019-05-13 23:00 ` Mark H Weaver
2019-05-14 4:22 ` Nala Ginrut [this message]
2019-05-14 20:22 ` Mark H Weaver
2019-05-15 9:31 ` Nala Ginrut
2019-05-16 0:58 ` Mark H Weaver
2019-05-17 11:07 ` Nala Ginrut
2019-05-18 23:06 ` Mark H Weaver
2019-05-15 10:09 ` tomas
2019-05-15 11:25 ` Chris Vine
2019-05-15 12:08 ` tomas
2019-05-15 11:25 ` Nala Ginrut
2019-05-15 12:10 ` tomas
2019-05-15 12:26 ` Nala Ginrut
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='CAPjoZofSHzpvWnkC0Y8x=Sa-060XFTYZbWu90SzJuNPoVQ200A@mail.gmail.com' \
--to=nalaginrut@gmail.com \
--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).