From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: Concurrency, again Date: Thu, 27 Oct 2016 12:13:00 -0700 Message-ID: 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> <8360odu2gp.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1477595797 6395 195.159.176.226 (27 Oct 2016 19:16:37 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 27 Oct 2016 19:16:37 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 Cc: stefan.huchler@mail.de, emacs-devel@gnu.org To: Eli Zaretskii , Philipp Stephani Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 27 21:16:33 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 1bzqA0-000848-3S for ged-emacs-devel@m.gmane.org; Thu, 27 Oct 2016 21:16:20 +0200 Original-Received: from localhost ([::1]:44057 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzqA2-00070n-8o for ged-emacs-devel@m.gmane.org; Thu, 27 Oct 2016 15:16:22 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bzq6v-000594-I0 for emacs-devel@gnu.org; Thu, 27 Oct 2016 15:13:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bzq6q-00033c-Ja for emacs-devel@gnu.org; Thu, 27 Oct 2016 15:13:09 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:34526) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bzq6q-000333-9y; Thu, 27 Oct 2016 15:13:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:Cc:References:To:Subject; bh=UEnZ4ld/hXeWfR6cWCxaRH56dVpGo0otthXV+XqGrHI=; b=hL/YW8Jn1mlgeK1NZukNiV1C/Sy/33Uh4JrpRmsqdAjOjykENeO8W0+dxb+mB76QEMEW2Djm56tzgxQb+JIqSPs0pHo1HGidRx4BtOHM9RQzPlkM/P1bfOHU6v+FP52w7pP6HCHLJh+e+KQIloQ5b5lWatoinbzp/xfFO361pizJgqv2TAYn6seDTaEeY59/M3BPMuxmJY0uLqGGusspoR9eLS24DeCWp7TD3zbX/20uZ65+lvpiFPEBkA17biuaFWek/faNaw9vKcgNOc0Va0raJyBxYdLf+YYU0Yz3v8Pja2ehT6KVKTcAPaUoJpbA/rtVgpSGmyYGnB8iFE0dww==; Original-Received: from c-73-97-199-232.hsd1.wa.comcast.net ([73.97.199.232] helo=[192.168.1.173]) by dancol.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1bzq6o-0007fx-3I; Thu, 27 Oct 2016 12:13:02 -0700 In-Reply-To: <8360odu2gp.fsf@gnu.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 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:208885 Archived-At: On 10/27/2016 10:27 AM, Eli Zaretskii wrote: >> From: Philipp Stephani >> Date: Tue, 25 Oct 2016 23:28:51 +0000 >> >> I've pushed the experimental branch to 'concurrency-libtask'. It's essentially a simple wrapper around libtask, >> which implements CSP based on setcontext. I've also implemented a Windows equivalent based on >> Windows native fibers, but haven't tried that yet. > > Thanks. > > Could you perhaps summarize the relative advantages and disadvantages > of the two concurrency branches? Your branch doesn't have any > documentation besides doc strings of the new primitives, so it's not > easy to grasp the high-level picture by looking at the details. > > One issue that bothers me is whether it's wise to use libtask here, > because the changes you did there seem to imply that we will have to > maintain the library (which is pretty low-level stuff) as part of > Emacs. Isn't using system threads better? Agreed on system threads vs libtask. Fibers of the sort libtask provides (similar to GNU Pth) have some claimed advantages in efficiency in large programs with lots of concurrent tasks, but for us, I vote for Python-style use of OS threads with a Python-style GIL that we can release to do long-running computations and recover from parallelism. (I believe the existing concurrency branch runs under this model already, but I'll have to take a closer look.) System threads also have much better integration with the debugger and other development tools; fibers have no offsetting advantages for us.