From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chris Vine Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: anyone define port types? Date: Mon, 20 Jun 2016 10:01:57 +0100 Message-ID: <20160620100157.530fc347@dell.homenet> References: <87y492mnjp.fsf@pobox.com> <87pots9tag.fsf@gnu.org> <87bn37wtf2.fsf@pobox.com> <20160612092513.3eb1c8a3@laptop.homenet> <8760t5mthu.fsf@pobox.com> <20160619163327.36246706@dell.homenet> <8737o9kr3g.fsf@pobox.com> <20160619210912.48528ffa@dell.homenet> <20160620074503.6d06426b@dell.homenet> <87y460jou5.fsf@pobox.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1466413346 4331 80.91.229.3 (20 Jun 2016 09:02:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 20 Jun 2016 09:02:26 +0000 (UTC) To: guile-user , guile-devel Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jun 20 11:02:16 2016 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 1bEv5v-0006Xc-OK for guile-devel@m.gmane.org; Mon, 20 Jun 2016 11:02:11 +0200 Original-Received: from localhost ([::1]:42180 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEv5v-0004Hh-2k for guile-devel@m.gmane.org; Mon, 20 Jun 2016 05:02:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51706) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEv5n-0004HW-MV for guile-devel@gnu.org; Mon, 20 Jun 2016 05:02:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bEv5k-0001dA-Ho for guile-devel@gnu.org; Mon, 20 Jun 2016 05:02:03 -0400 Original-Received: from avasout08.plus.net ([212.159.14.20]:32930) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bEv5k-0001cp-Bi for guile-devel@gnu.org; Mon, 20 Jun 2016 05:02:00 -0400 Original-Received: from dell.homenet ([87.114.218.169]) by avasout08 with smtp id 8x1x1t0063fstn301x1zwe; Mon, 20 Jun 2016 10:01:59 +0100 X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=O6PEx0JW c=1 sm=1 tr=0 a=4ynVEcF4YjHkqINdvT3UIQ==:117 a=4ynVEcF4YjHkqINdvT3UIQ==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=kj9zAlcOel0A:10 a=pD_ry4oyNxEA:10 a=ybZZDoGAAAAA:8 a=d8NvP7S4Scne46xfdmYA:9 a=CjuIK1q_8ugA:10 a=0RhZnL1DYvcuLYC8JZ5M:22 Original-Received: from dell.homenet (localhost [127.0.0.1]) by dell.homenet (Postfix) with ESMTP id BE6B7443386; Mon, 20 Jun 2016 10:01:57 +0100 (BST) In-Reply-To: <87y460jou5.fsf@pobox.com> X-Mailer: Claws Mail 3.13.1 (GTK+ 2.24.30; x86_64-unknown-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 212.159.14.20 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.lisp.guile.devel:18360 gmane.lisp.guile.user:12660 Archived-At: On Mon, 20 Jun 2016 09:34:26 +0200 Andy Wingo wrote: [snip] > I must not be communicating clearly because this is definitely not > what I am proposing. The prompt doesn't service anything, and it's > just the one user-space thread which is suspended, and when it > suspends, it suspends back to the main loop which runs as usual, > timers and all. > > prompt > /------\ /------------\|/-----------\ /------------\ /----------\ > | main --> run-thread -|>(user code)--> read-char --> waiter | > | loop | | ||| | | | | | > \------/ \------------/|\-----------/ \------------/ \--|-------/ > ^ | > \-------------------------------/ > stack grows this way -> > > The current-read-waiter aborts to a prompt. That prompt is instated > when the thread is run or resumed. When you abort to that prompt, you > add the FD to the poll set / main loop / *, remember the delimited > continuation, and return to the main loop. When the fd becomes > readable or the gsource fires or whatever, you reinstate the > delimited continuation via a new invocation of run-thread (prompt and > all). Ah right, that is clearer, thank you. There would indeed be a prompt for each user glib event source comprised in the "thread" abstraction, which the read-waiter (or whatever) aborts to. It is that abstraction that I was missing and will need to look at. Chris