unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Chris Vine <vine.chris@gmail.com>
To: guile-devel@gnu.org
Subject: Re: [PATCH] Add current-suspendable-io-status parameter
Date: Wed, 15 May 2019 12:25:05 +0100	[thread overview]
Message-ID: <20190515122505.0e8d57a2cf1e5f4d0962e31c@gmail.com> (raw)
In-Reply-To: <20190515100919.GG32396@tuxteam.de>

On Wed, 15 May 2019 12:09:19 +0200
<tomas@tuxteam.de> wrote:
> On Mon, May 13, 2019 at 06:54:38PM +0800, Nala Ginrut wrote:
> > Hi folks!
> > Here's a patch to add current-suspendable-io-status:
> > Its result is a pair: (finished-bytes . rest-bytes)
> 
> Sorry for this possibly dumb question, but... is there a way
> to be non-blocking even if there are no readable/writable
> bytes at all? Or would one have to do multi-threading (and
> let the single threads [1] block) for that?
> 
> Thanks

With guile-2.2/3.0, you install suspendable ports and parameterize
current-read-waiter and/or current-write-waiter.  There is an example
here:
https://github.com/ChrisVine/guile-a-sync2/blob/master/a-sync/await-ports.scm

fibers does something similar.  See also
https://www.gnu.org/software/guile/docs/master/guile.html/Non_002dBlocking-I_002fO.html#Non_002dBlocking-I_002fO

Chris



  reply	other threads:[~2019-05-15 11:25 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
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 [this message]
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=20190515122505.0e8d57a2cf1e5f4d0962e31c@gmail.com \
    --to=vine.chris@gmail.com \
    --cc=guile-devel@gnu.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).