From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Concurrency, again Date: Mon, 31 Oct 2016 00:42:58 -0600 Message-ID: <87d1ihuih9.fsf@tromey.com> 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> <83funkwfzf.fsf@gnu.org> <87k2cwe4wl.fsf@jupiter.lan> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1477896295 17867 195.159.176.226 (31 Oct 2016 06:44:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 31 Oct 2016 06:44:55 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) Cc: Stefan Huchler , emacs-devel@gnu.org To: Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 31 07:44:51 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 1c16Ki-00023X-2I for ged-emacs-devel@m.gmane.org; Mon, 31 Oct 2016 07:44:36 +0100 Original-Received: from localhost ([::1]:33557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c16Kk-0004OK-Oc for ged-emacs-devel@m.gmane.org; Mon, 31 Oct 2016 02:44:38 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49973) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c16Jc-0003ld-GV for emacs-devel@gnu.org; Mon, 31 Oct 2016 02:43:29 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c16JY-00072I-Gr for emacs-devel@gnu.org; Mon, 31 Oct 2016 02:43:28 -0400 Original-Received: from gproxy6-pub.mail.unifiedlayer.com ([67.222.39.168]:42729) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1c16JY-00070A-3x for emacs-devel@gnu.org; Mon, 31 Oct 2016 02:43:24 -0400 Original-Received: (qmail 1746 invoked by uid 0); 31 Oct 2016 06:43:08 -0000 Original-Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy6.mail.unifiedlayer.com with SMTP; 31 Oct 2016 06:43:07 -0000 Original-Received: from box522.bluehost.com ([74.220.219.122]) by cmgw2 with id 26ix1u00U2f2jeq016j0RF; Mon, 31 Oct 2016 00:43:06 -0600 X-Authority-Analysis: v=2.1 cv=PIacp5aC c=1 sm=1 tr=0 a=GsOEXm/OWkKvwdLVJsfwcA==:117 a=GsOEXm/OWkKvwdLVJsfwcA==:17 a=L9H7d07YOLsA:10 a=9cW_t1CCXrUA:10 a=s5jvgZ67dGcA:10 a=CH0kA5CcgfcA:10 a=pGLkceISAAAA:8 a=QydgsYEstUuwiUrP87wA:9 a=6kGIvZw6iX1k4Y-7sg4_:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From; bh=jeBcgKp6BOeqn/Qa29/nN8u7o44aV0uPkOiJ57QeODM=; b=ij31qZmEqZHDLwtXLr6E8yucVv 71mtR7V/SaiOHEevobTjBjQ3Mu9JV2WfjU+bua4QxezJu9Hsq7LZahatio0KQYqjs3BfcWPYi4hAu t7Vi5GmSa2gJJOnHTURAs63K/; Original-Received: from 174-16-143-211.hlrn.qwest.net ([174.16.143.211]:34894 helo=bapiya) by box522.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.86_1) (envelope-from ) id 1c16J9-0000ci-D4; Mon, 31 Oct 2016 00:42:59 -0600 X-Attribution: Tom In-Reply-To: (Philipp Stephani's message of "Tue, 25 Oct 2016 23:28:51 +0000") X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box522.bluehost.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 174.16.143.211 X-Exim-ID: 1c16J9-0000ci-D4 X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 174-16-143-211.hlrn.qwest.net (bapiya) [174.16.143.211]:34894 X-Source-Auth: tom+tromey.com X-Email-Count: 5 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTIyLmJsdWVob3N0LmNvbQ== X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 67.222.39.168 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:209007 Archived-At: >>>>> "Philipp" == Philipp Stephani writes: Philipp> I've pushed the experimental branch to Philipp> 'concurrency-libtask'. It's essentially a simple wrapper around Philipp> libtask, which implements CSP based on setcontext. I've also Philipp> implemented a Windows equivalent based on Windows native Philipp> fibers, but haven't tried that yet. I took a quick look at it. I think one thing to know is that the existing concurrency branch has two distinct parts. One part is changing various bits of Emacs internals to cope with multiple threads. The other part is the design and implementation of the thread API that is exposed to Emacs Lisp. IMO the concurrency branch's approach to the internals changes is generally preferable here. There are a few issues I saw: * AFAICT concurrency-libtask doesn't correctly handle updating let bindings when task switching; * It doesn't make the match data per-task; * Nor the current buffer; * It doesn't handle the case where multiple tasks select on an fd at the same time (the concurrency branch also adds process locking, which I thought was handy) These could be solved of course -- they're already all solved on the concurrency branch. There may be more things there that I've forgotten about as well. If channels are preferred to locks, it doesn't seem hard to either simply make channels the API on the concurrency branch; or just write channels as some lisp around the current code. Tom