From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: Passing objects between threads Date: Sun, 11 Sep 2016 20:34:16 +0200 Message-ID: <87mvjeb80n.fsf@pobox.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1473618908 5949 195.159.176.226 (11 Sep 2016 18:35:08 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2016 18:35:08 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cc: "guile-user@gnu.org" To: Panicz Maciej Godek Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Sep 11 20:35:04 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bj9ak-0000Kr-76 for guile-user@m.gmane.org; Sun, 11 Sep 2016 20:34:58 +0200 Original-Received: from localhost ([::1]:38661 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj9ah-0006xL-4q for guile-user@m.gmane.org; Sun, 11 Sep 2016 14:34:55 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46809) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj9aI-0006x0-AU for guile-user@gnu.org; Sun, 11 Sep 2016 14:34:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bj9aE-0002PF-5Y for guile-user@gnu.org; Sun, 11 Sep 2016 14:34:29 -0400 Original-Received: from pb-sasl1.pobox.com ([64.147.108.66]:63409 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bj9aD-0002Oz-Vu for guile-user@gnu.org; Sun, 11 Sep 2016 14:34:26 -0400 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 90C7A38B03; Sun, 11 Sep 2016 14:34:24 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=suEzYamqZ5KwQRt6R0GneLNn/vM=; b=vTf99L DZKYWMhwnafaHwpkUz6pfJUlKe4DSWiZO+K2hBjkVg+SUG+LFzUSc7jbBIQEiCBv ioyd4DId8w4054efx+jgxmIto4IM2dtp5NOgUdpckSdEvstEr4Rszo2E385OREWu S7dEnptjBkVYw42mIrf8roCh5bRoQtUEQmXNA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=XT4fDq8txyUF6RWANRS2lwnLaunUrtIJ ZbBixaroTbgrEDb7UkmXsXMWIX053tKnmoLVLEm5i14/bXMV9qEdogZ6Jagykulu ch22Lh4z+tqkfMBVYlpoQ6ZA+sSwZE3ty7PEgXwWp6jB42GDAb2RaGkA2kaNzKub g10lX7JW29E= Original-Received: from pb-sasl1.nyi.icgroup.com (unknown [127.0.0.1]) by pb-sasl1.pobox.com (Postfix) with ESMTP id 89E0238B02; Sun, 11 Sep 2016 14:34:24 -0400 (EDT) Original-Received: from clucks (unknown [88.160.190.192]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pb-sasl1.pobox.com (Postfix) with ESMTPSA id CC8D438B01; Sun, 11 Sep 2016 14:34:23 -0400 (EDT) In-Reply-To: (Panicz Maciej Godek's message of "Sat, 10 Sep 2016 11:37:55 +0200") X-Pobox-Relay-ID: 5CCC2DD2-784E-11E6-B462-CE686462E9F6-02397024!pb-sasl1.pobox.com X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.147.108.66 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:12900 Archived-At: On Sat 10 Sep 2016 11:37, Panicz Maciej Godek 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