From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Concurrency, again Date: Tue, 25 Oct 2016 13:27:39 +0000 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> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a114e2a8e98212f053fb0797e X-Trace: blaine.gmane.org 1477402195 14413 195.159.176.226 (25 Oct 2016 13:29:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 25 Oct 2016 13:29:55 +0000 (UTC) To: Stefan Monnier , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 25 15:29:49 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 1bz1n9-00007w-H6 for ged-emacs-devel@m.gmane.org; Tue, 25 Oct 2016 15:29:23 +0200 Original-Received: from localhost ([::1]:54499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz1nB-0001AO-Py for ged-emacs-devel@m.gmane.org; Tue, 25 Oct 2016 09:29:25 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57427) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz1lh-0008TK-0L for emacs-devel@gnu.org; Tue, 25 Oct 2016 09:27:53 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bz1lf-0007ji-Sv for emacs-devel@gnu.org; Tue, 25 Oct 2016 09:27:52 -0400 Original-Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:37691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bz1lf-0007jN-LN for emacs-devel@gnu.org; Tue, 25 Oct 2016 09:27:51 -0400 Original-Received: by mail-wm0-x236.google.com with SMTP id c78so24549867wme.0 for ; Tue, 25 Oct 2016 06:27:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=JUB5+TeYLVOqz3keBr3HRw8vDg4qxvuzhnWjxk1LgSc=; b=roeajDXAe9mg9TtkpnuuphQMYHRn75NTmcx6/khafnAp6Isfn3HzfUR5VcfeekwC7A JwYNebgJ16GJMOhFzloKJZpKevePnWy3CUAl1200zYru8z8FhiPs6zfduxV0+Z8+aIe4 Q6CkNtHiA9/g6Ngs1YleNFoqtBBReuuWYTYI6czUqIt9z4sAzgoUdAZv6+Ws8I52g4j7 2RlCVDh1uKEtfEoFnvqi+/n9q9g/ek/7lnenzcZovpiUayeKPAULHNbjRj2N6sOjql2W hk5rPpiiXY3lPyT7ug21p9PnOK5o/BG5wpaVxit8n8yJfq8WtZ8XDopZW7S+D2AdNJvy D/tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=JUB5+TeYLVOqz3keBr3HRw8vDg4qxvuzhnWjxk1LgSc=; b=Sb7RIRbdgStuCBYPlTftdFpIt57RQEa7DZ7AAy9U3RhcU89a13dRp6wComL0mp7XT3 Nh9cYsEkFfeJwHe5rmC3q+susncnXcePF2p1NNVNkhlS5cUyYDshciJEvh8JJSR4A8A+ Hgy6w82h9z8hV8B7s3P8Gti0dFkrmJK4rsSe7Z9rJ6ZZNxH5bKC0iu3FCVmocXUg/M5t u025av3/L0f3OI1dSCRSpWniPq5/T1XtMhQYFTxbB6pftvQgDElheT8ZX+BkhB6bVbEc /iPdutkUzuxo96h7ZAOssZQx/nKNDdZy1IytqJmqmyq5Xn2mygZzNGH6WTbAtFkT7TWZ 3nFg== X-Gm-Message-State: ABUngvefqnh91pNaDx2m8O3/1AHWtMo81EcKetMYalcz49aYkSO6A38JJFyTYa/oPAh3nOopBaZiFNpmndB+AA== X-Received: by 10.28.191.3 with SMTP id p3mr3557051wmf.112.1477402070350; Tue, 25 Oct 2016 06:27:50 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c: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:208759 Archived-At: --001a114e2a8e98212f053fb0797e Content-Type: text/plain; charset=UTF-8 John Wiegley schrieb am Mi., 12. Okt. 2016 um 18:43 Uhr: > >>>>> "SM" == Stefan Monnier writes: > > SM> IOW, I completely agree with Eli: we should fix the few remaining > issues > SM> with the concurrency branch and merge it into master. > > I very strongly disagree. I think "merge what we have and make it work" is > the > wrong approach. I agree, there should at least be some more discussion about the design we want. You could group the concurrency problem into a couple of subproblems: - Context switching - Scheduling - Communication - Synchronization IIUC the concurrency branch uses OS threads plus custom code for context switching and scheduling, global variables for communication, and OS mutexes/condvars for synchronization. My experiment uses setcontext for context switching, a user mode scheduler for scheduling, and CSP without shared state for both communication and synchronization. I think CSP has the advantage of being higher-level and avoiding low-level bugs due to misuse of synchronization primitives such as mutexes. --001a114e2a8e98212f053fb0797e Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


John W= iegley <jwiegley@gmail.com>= schrieb am Mi., 12. Okt. 2016 um 18:43=C2=A0Uhr:
>>>>> "SM" =3D=3D Stefan Monnier &l= t;monnier@iro.umontreal.ca> writes:

SM> IOW, I completely agree with Eli: we should fix the few remaining is= sues
SM> with the concurrency branch and merge it into master.

I very strongly disagree. I think "merge what we have and make it work= " is the
wrong approach.

I agree, there should at le= ast be some more discussion about the design we want.
You could g= roup the concurrency problem into a couple of subproblems:
- Cont= ext switching
- Scheduling
- Communication
- = Synchronization
IIUC the concurrency branch uses OS threads plus = custom code for context switching and scheduling, global variables for comm= unication, and OS mutexes/condvars for synchronization. My experiment uses = setcontext for context switching, a user mode scheduler for scheduling, and= CSP without shared state for both communication and synchronization. I thi= nk CSP has the advantage of being higher-level and avoiding low-level bugs = due to misuse of synchronization primitives such as mutexes.
--001a114e2a8e98212f053fb0797e--