all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: "Clément Lassieur" <clement@lassieur.org>
Cc: 32121@debbugs.gnu.org
Subject: [bug#32121] [PATCH 2/5] utils: Reset the Fiber dynamic environment in %NON-BLOCKING.
Date: Sat, 14 Jul 2018 15:45:58 +0200	[thread overview]
Message-ID: <87in5iaq21.fsf@gnu.org> (raw)
In-Reply-To: <87k1pyf20x.fsf@lassieur.org> ("Clément Lassieur"'s message of "Sat, 14 Jul 2018 14:13:50 +0200")

Clément Lassieur <clement@lassieur.org> skribis:

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> Clément Lassieur <clement@lassieur.org> skribis:
>>
>>> * src/cuirass/utils.scm (%non-blocking): Wrap body in PARAMETERIZE form that
>>> clears CURRENT-FIBER.
>>>
>>> So that PUT-MESSAGE doesn't try to suspend itself within CALL-WITH-NEW-THREAD.
>>> See https://lists.gnu.org/archive/html/guile-devel/2018-07/msg00009.html.
>>
>> Good catch!
>>
>>> +  (parameterize (((@@ (fibers internal) current-fiber) #f))
>>> +    (let ((channel (make-channel)))
>>
>> Instead of using @@, I think you can add an explicit:
>>
>>   #:use-module ((fibers internal) #:select (current-fiber))
>
> That doesn't work because it would select the exported variable (as '@'
> would have done), that is: the value of the parameter.  What I need is
> the parameter itself, which is hidden.
>
> See (fibers internal):
>
>   #:export ;; Low-level interface: schedulers and threads.
>
>             [...]
>
>             (current-fiber/public . current-fiber)
>   [...]
>
> (define current-fiber (make-parameter #f))
> (define (current-fiber/public)
>   "Return the current fiber, or @code{#f} if no fiber is current."
>   (current-fiber))

Oh I see.  Thanks for explaining!

Ludo’.

  reply	other threads:[~2018-07-14 13:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-10 22:58 [bug#32121] Cuirass: add support for multiple inputs Clément Lassieur
2018-07-10 23:02 ` [bug#32121] [PATCH 1/5] base: Compile CHECKOUT in the fiber Clément Lassieur
2018-07-10 23:02   ` [bug#32121] [PATCH 2/5] utils: Reset the Fiber dynamic environment in %NON-BLOCKING Clément Lassieur
2018-07-13  8:35     ` Ludovic Courtès
2018-07-14 12:13       ` Clément Lassieur
2018-07-14 13:45         ` Ludovic Courtès [this message]
2018-07-10 23:02   ` [bug#32121] [PATCH 3/5] database: Add support for database upgrades Clément Lassieur
2018-07-13  8:47     ` Ludovic Courtès
2018-07-14 15:00       ` Clément Lassieur
2018-07-14 15:32     ` Clément Lassieur
2018-07-16 13:17       ` Ludovic Courtès
2018-07-10 23:02   ` [bug#32121] [PATCH 4/5] database: Call a specification 'jobset' instead of 'project' Clément Lassieur
2018-07-13  8:51     ` Ludovic Courtès
2018-07-13  9:35       ` Clément Lassieur
2018-07-13  9:43         ` Clément Lassieur
2018-07-13 11:56         ` Ludovic Courtès
2018-07-14 19:57           ` Clément Lassieur
2018-07-10 23:02   ` [bug#32121] [PATCH 5/5] Add support for multiple inputs Clément Lassieur
2018-07-13  9:28     ` Ludovic Courtès
2018-07-15  8:25       ` Clément Lassieur
2018-07-16 20:13       ` bug#32121: " Clément Lassieur
2018-07-13  8:32   ` [bug#32121] [PATCH 1/5] base: Compile CHECKOUT in the fiber Ludovic Courtès
2018-07-13  8:55     ` Clément Lassieur
2018-07-13 11:50       ` Ludovic Courtès
2018-07-13 11:57         ` Clément Lassieur

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=87in5iaq21.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=32121@debbugs.gnu.org \
    --cc=clement@lassieur.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.