From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: Concurrency, again Date: Mon, 17 Oct 2016 14:33:16 -0400 Message-ID: <5B6D2CCB-4D96-40E4-BE43-EE49E3D2F1D7@raeburn.org> References: <87wq97i78i.fsf@earlgrey.lan> <86k2dk77w6.fsf@molnjunk.nocrew.org> <9D64B8EA-DB52-413D-AE6A-264416C391F3@iotcl.com> <83int1g0s5.fsf@gnu.org> <83twckekqq.fsf@gnu.org> <83mvi9a3mh.fsf@gnu.org> <20161012165911.58437154@jabberwock.cb.piermont.com> <20161012173314.799d1dc5@jabberwock.cb.piermont.com> <8360owaj2s.fsf@gnu.org> <20161013092701.77461800@jabberwock.cb.piermont.com> <87insvt0i9.fsf@lifelogs.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1476729417 25465 195.159.176.226 (17 Oct 2016 18:36:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 18:36:57 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 17 20:36:53 2016 Return-path: Envelope-to: ged-emacs-devel@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 1bwCmF-0005YW-52 for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 20:36:47 +0200 Original-Received: from localhost ([::1]:35033 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwCmH-0005JO-65 for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 14:36:49 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:36053) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwCj0-0003Uk-Cc for emacs-devel@gnu.org; Mon, 17 Oct 2016 14:33:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwCiw-0006Yt-9t for emacs-devel@gnu.org; Mon, 17 Oct 2016 14:33:26 -0400 Original-Received: from mail-qk0-x236.google.com ([2607:f8b0:400d:c09::236]:33450) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwCiw-0006Y8-3o for emacs-devel@gnu.org; Mon, 17 Oct 2016 14:33:22 -0400 Original-Received: by mail-qk0-x236.google.com with SMTP id n189so250725582qke.0 for ; Mon, 17 Oct 2016 11:33:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raeburn-org.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=QJNyD3UvMF/TuZb3Yj0oqBTbSe3tyIZ6okmZzqnrzAo=; b=Sn44iMk/6gazJvXnLaj+D2qOm0IVay0B8omCKbNM1cz75oUEzSuzfl5MTytz40oBH4 kMMcZ3QkEOB6FvsA0Nv85A+Y5d2u/hVn3W4NQnH6akaxMvD3qaUXA77EAX6ren9Q/2Et 78aEFK5f6tuYlF0J5phGVz6EDTuBUoiECfH+57vCbnQnHyIgNlcDwf7UkkavkEZ/c46G yy6hPxn7707xpKArJ5yQRgas1j44suL9sVnad+ZvaIMMZxaFCrW+4ejWJ/8TzggcCfR7 ahUhgZSNMoua7a4WBdZAe8mRiCODB52lcZuo9WqsPb9gmGgq5MGqAHniTTd8GS3yq4gm +piQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=QJNyD3UvMF/TuZb3Yj0oqBTbSe3tyIZ6okmZzqnrzAo=; b=Di2fFK4t4F6KEwrPWSe8+w+WRjjxMGayMmfUoi6I+Bjvw2myc6EfROHHfNaiyu67Om yoYMUun67fgbo+qftCfdIclUqVXaLCL1wdkwKtG6OnjUZKmJv/uwRRCyJekBPWttxz4l asFSKLywpAoeysDLmLEK6ztnKu+zSHyjZ+yBjFC6NwD2vXaUuNRKSBDYY4SJWrFJQG34 w3cR0EkFcrtr0B8gDGyB6TJ+VxYtCJUf3ymSREpxAI51OUr9cwHcwRf+YfDGpPfpEOQH dTPmSrQ8GL9B/7E7dKUyNbO9k2auOCMmT/ur/BS/J08zCD0HKVeLUPIZKHjHq8OVfGcb S6xw== X-Gm-Message-State: AA6/9RnMtvsvWK0IgtWgYxxMQURr+Hzr6sqSH+ehAr1n72kzXbI7H3xj704f+ovwF/+f5A== X-Received: by 10.55.73.23 with SMTP id w23mr24387043qka.13.1476729200099; Mon, 17 Oct 2016 11:33:20 -0700 (PDT) Original-Received: from [192.168.23.52] (c-50-138-183-136.hsd1.ma.comcast.net. [50.138.183.136]) by smtp.gmail.com with ESMTPSA id d127sm3842973qkf.24.2016.10.17.11.33.18 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 11:33:18 -0700 (PDT) In-Reply-To: <87insvt0i9.fsf@lifelogs.com> X-Mailer: Apple Mail (2.3124) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400d:c09::236 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:208377 Archived-At: We=E2=80=99re getting quite a list of =E2=80=9Ccoffee-break inducing = moments=E2=80=9D. :-) To what=E2=80=99s been posted so far, I=E2=80=99ll add a couple of cases = that I=E2=80=99ve run into trouble with, which might be helped in part = with multiple threads: - regexp scanning in a huge file that took so long my IM sessions would = time out because the Emacs-based client code couldn=E2=80=99t respond to = the server (which scanning also turned out not to be interruptible with = ^G) - file operations hanging for minutes at a time when an NFS session = stalls due to network lossage, freezing the UI, causing IM session = timeouts, etc; I=E2=80=99d love for auto-revert-mode type timestamp = checking for buffers I=E2=80=99m not editing at the moment to not lock = up my entire Emacs session in that situation, and it=E2=80=99d be a huge = amount of work, but being able to cancel or abort a hung =E2=80=9Csave=E2=80= =9D or find-file operation would be pretty nice Letting the IM client code use a helper thread for callbacks could help, = as long as regexp scanning and file operations release the global lock. = Having the UI not freeze up during file operations is probably more = complicated, especially if we want to let the user hit ^G and go do = something else, since NFS operations tend (depending on implementation) = to be uninterruptible. In the latter case (and probably some others, like Perry=E2=80=99s video = playback in an eww buffer), C-level threads mostly invisible to Lisp = might suffice, but I think there are a number of cases where we do want = concurrent evaluation of multiple bodies of Lisp code, which code is = often most logically written in structured or functional programming = style, not =E2=80=9Cmassive pile of callbacks=E2=80=9D style.=