From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: John Cowan Newsgroups: gmane.lisp.guile.user Subject: Re: Guile fibers return values Date: Mon, 6 Jan 2020 16:47:12 -0500 Message-ID: References: <20200105123329.5019662bdf1895a4164faf62@gmail.com> <20200105142358.4ad96d15a23a0b947b2d55e3@gmail.com> <547672e4-30f7-2783-f3d5-199417a71c98@posteo.de> <20200105214555.60e424b8cf86456e188c75f6@gmail.com> <7661b27f-787e-fc8f-d653-5fbabffa01f7@posteo.de> <20200106211456.68c8a637631a4e1e977d8443@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="254235"; mail-complaints-to="usenet@blaine.gmane.org" Cc: Guile User To: Chris Vine Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Mon Jan 06 22:47:51 2020 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ioaE2-0013rT-D9 for guile-user@m.gmane.org; Mon, 06 Jan 2020 22:47:50 +0100 Original-Received: from localhost ([::1]:38552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioaE0-0008Cq-EV for guile-user@m.gmane.org; Mon, 06 Jan 2020 16:47:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47673) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ioaDe-0008Bg-G3 for guile-user@gnu.org; Mon, 06 Jan 2020 16:47:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ioaDc-0001y8-J8 for guile-user@gnu.org; Mon, 06 Jan 2020 16:47:26 -0500 Original-Received: from mail-qk1-x735.google.com ([2607:f8b0:4864:20::735]:37318) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ioaDc-0001x1-8z for guile-user@gnu.org; Mon, 06 Jan 2020 16:47:24 -0500 Original-Received: by mail-qk1-x735.google.com with SMTP id 21so40917633qky.4 for ; Mon, 06 Jan 2020 13:47:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ccil-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zF/KCoEVfCRJmnKuc7kWpjb4LCo6cc1dhpIrkZAu02E=; b=vIji8qFLo8h98IZhZOrDmAh00uss7IBQlwRrLgHS6ULugmKKr7NfDyYRUBWxsZ13pz RmLbHXNkeKJ/mNicIlIJCFFIqFcB3IbQJCO664Znin8LTCt8wMLJCCJM2bPd4sxiFGEo wCTNMtxc+oQFENgDjHGhep0uhKp+vfMFSmTozci3Naol64lA98xbldbc2LGtF0t9xk5U SxmD9jcswx/PwXOqj0rjm9MMR4Bza2QOqhcbONW5Tf6iZEa5DuFfsddxeRUMqY5Xd629 mY+kH0Qj0rD0CQKCa+r2evucEBHzaG1ZzUocrvSLh49iOgsEdV8al4lZAeEfiR8I9Vdl fbmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zF/KCoEVfCRJmnKuc7kWpjb4LCo6cc1dhpIrkZAu02E=; b=Nu+7TMwga9r3JZSPoafnEYEAJQn7bJ+1SZ4+CcVCpVPelh86kLluumQ6MPN6R4PmSw OHRsraF9v+BOfrx3EdhVX71WVzkfp4UgnL8EZscmPTee1kqezMEX9I8tRR+LEPxM2BaS anpGdf1hZ75BQeHYUcaAoF9fNsvaCLH2kjgAmUJ+/wdKL6nQz/wuoqy+EGubFlwuA4SB GXscLx2F5z9myHRAFb1gvbauKXhG5bluBWE15+le/LgUVNwtLM6RfO2Iy1EmhXX817VA 6brg6/5bSOIZWplP0vqXbIWpkqtveSMIdMO2rIgk/owfHtDQzrTu7Lvbk04aE6CA4hGj xHHw== X-Gm-Message-State: APjAAAXyCLB3JHDIIZjnUKFJoEKjGn6iv8csdCALTsF23pQI5EYe90n9 wQJclm3Qjdoc5pe3yjcJhYBj+ByxiwpLabRWL80RQQ== X-Google-Smtp-Source: APXvYqz2Q3crm+1qUG503vo+trrPFs/OdLet8CtJlsyj5UViNKAgY/peXf4maRBHMJvlQsw/xbrndGHQCEDd0qT33WY= X-Received: by 2002:a05:620a:12c4:: with SMTP id e4mr86244700qkl.359.1578347243428; Mon, 06 Jan 2020 13:47:23 -0800 (PST) In-Reply-To: <20200106211456.68c8a637631a4e1e977d8443@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::735 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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:16001 Archived-At: Conceptually, parallelism and concurrency are two different and partly independent things. Parallelism refers to physically simultaneous execution, as when you throw a ball into the air in each hand and catch it in the same hand. Each throw-catch cycle is a parallel process (using "process" in the broad sense of the term). Concurrency, on the other hand, is *logically* simultaneous execution, as when you juggle three balls in one or two hands. Now the throw-catch cycle of each ball from one hand to the other is a concurrent process, and it is also a parallel process if you use two hands. If you are using one hand, however, there is no parallelism in juggling. To make matters more confusing, "futures" in Racket are for parallelism, whereas in Guile they are for concurrency. Guile "parallel" and friends are executed on futures (which are executed on OS threads), but use at most as many futures as there are CPUs, so physically simultaneous execution is at least encouraged if not actually guaranteed. Racket parallelism only operates until one of the parallel processes blocks or needs to synchronize (which includes things like allocating memory): they are not implemented on top of Racket threads, which are for concurrency (and have nothing to do with OS threads). A Scheme promise can be viewed as a type of parallel process that doesn't actually provide parallelism (and in fact my parallel pre-SRFI is called "parallel promises" and treats ordinary promises as a degenerate case) or as a future that doesn't start to execute until you wait for it to finish (and my futures pre-SRFI also treats promises as a degenerate case). On Mon, Jan 6, 2020 at 4:15 PM Chris Vine wrote: > On Mon, 6 Jan 2020 20:42:17 +0100 > Zelphir Kaltstahl wrote: > [snip] > > In Racket the futures have some limitations, where one needs to use a > > different number type to enable them in some cases to run in parallel = =E2=80=93 > > wait, I am looking for the link =E2=80=A6 here: > > https://docs.racket-lang.org/guide/parallelism.html =E2=80=93 Is there = any > > similar restriction for futures in Guile? > > I don't know. I should try it and see. > >