From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Christopher Allan Webber Newsgroups: gmane.lisp.guile.devel Subject: Re: Asynchronous event loop brainstorm at FSF 30 Date: Tue, 17 Nov 2015 11:46:24 -0600 Message-ID: <87io505xhy.fsf@dustycloud.org> References: <87k2r3tvzh.fsf@dustycloud.org> <20151004171540.7a4eeb3c@bother.homenet> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447782460 28980 80.91.229.3 (17 Nov 2015 17:47:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Nov 2015 17:47:40 +0000 (UTC) Cc: guile-devel@gnu.org To: Chris Vine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Nov 17 18:47:40 2015 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZykLu-0000RF-Iy for guile-devel@m.gmane.org; Tue, 17 Nov 2015 18:47:34 +0100 Original-Received: from localhost ([::1]:60010 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZykLu-0000Zw-0t for guile-devel@m.gmane.org; Tue, 17 Nov 2015 12:47:34 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51410) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZykLr-0000ZD-RJ for guile-devel@gnu.org; Tue, 17 Nov 2015 12:47:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZykLn-0007lh-UK for guile-devel@gnu.org; Tue, 17 Nov 2015 12:47:31 -0500 Original-Received: from dustycloud.org ([2600:3c02::f03c:91ff:feae:cb51]:46582) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZykLn-0007lb-Q1 for guile-devel@gnu.org; Tue, 17 Nov 2015 12:47:27 -0500 Original-Received: from earlgrey (localhost [127.0.0.1]) by dustycloud.org (Postfix) with ESMTPS id AC5EB2673E; Tue, 17 Nov 2015 12:47:26 -0500 (EST) In-reply-to: <20151004171540.7a4eeb3c@bother.homenet> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c02::f03c:91ff:feae:cb51 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:18033 Archived-At: Chris Vine writes: > It is certainly the case that mixing threads with coroutines is usually > best avoided, otherwise it becomes very difficult to know what code > ends up running in which particular thread and thread safety becomes a > nightmare. However, it would be good to allow a worker thread to post > an event to the event loop safely, whereby the handler for the posted > event would run in the event loop thread. asyncio allows this. > > Although not particularly pertinent to this proposal, which looks > great, I use coroutines implemented with guile's delimited > continuations for a minimalist "await" wrapper over glib's event loop > as provided by guile-gnome (the whole thing is about 20 lines of code), > which appears (to the user) to serialize the GUI or other events posted > to the event loop. When I don't want to use guile-gnome, which is most > of the time, I have my own (also minimalist) thread-safe event loop > using guile's POSIX wrapper for select. > > My uses of guile are pretty undemanding so as I say these are > minimalist. Something like asyncio for guile would be very nice indeed. > > Chris This sounds very interesting... is the source available? Could you point to it? Thanks! - Chris