guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Passing objects between threads


From: Andy Wingo
Subject: Re: Passing objects between threads
Date: Sun, 11 Sep 2016 20:34:16 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

On Sat 10 Sep 2016 11:37, Panicz Maciej Godek <address@hidden> writes:

> is there any easy way to create a channel (queue) that could be used to
> communicate between threads? In particular, if the queue is empty, I would
> like the consumer to wait until something appears in it (pretty much like
> the channels in Clojure)

If you are using kernel threads, you can use something like:

  https://lists.gnu.org/archive/html/guile-devel/2012-02/msg00033.html

If you are using a user-space library for lightweight concurrency like
8sync or something, they usually have a channel abstraction.  There is
one in https://github.com/wingo/fibers, for example (and in that one,
the channels are themselves threadsafe and can be used for passing data
between fibers running on different kernel threads).  A new release is
coming later this evening but it requires the latest development Guile.

I think more generally, now is a time for a lot of experimentation in
the concurrency side of Guile; I look forward to seeing what people
settle on :)

Andy



reply via email to

[Prev in Thread] Current Thread [Next in Thread]