From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: HaiJun Zhang Newsgroups: gmane.emacs.bugs Subject: bug#38807: [Feature request]: Support lisp workers like web workers. Date: Tue, 31 Dec 2019 08:40:06 +0800 Message-ID: References: <83o8vpn8g1.fsf@gnu.org> <87mub9u0ld.fsf@gmx.de> <831rslmxih.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="5e0a98ec_2e48f044_4379" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="75199"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 38807@debbugs.gnu.org To: Michael Albinus , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Dec 31 01:41:58 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1im5bh-000JQl-Cp for geb-bug-gnu-emacs@m.gmane.org; Tue, 31 Dec 2019 01:41:57 +0100 Original-Received: from localhost ([::1]:38078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1im5bg-0000LU-Aa for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Dec 2019 19:41:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45645) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1im5aq-00086r-Ce for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2019 19:41:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1im5ap-0007nf-2g for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2019 19:41:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55889) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1im5ao-0007n4-Jn for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2019 19:41:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1im5ao-0007kN-Gq for bug-gnu-emacs@gnu.org; Mon, 30 Dec 2019 19:41:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: HaiJun Zhang Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 31 Dec 2019 00:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38807 X-GNU-PR-Package: emacs Original-Received: via spool by 38807-submit@debbugs.gnu.org id=B38807.157775283029727 (code B ref 38807); Tue, 31 Dec 2019 00:41:02 +0000 Original-Received: (at 38807) by debbugs.gnu.org; 31 Dec 2019 00:40:30 +0000 Original-Received: from localhost ([127.0.0.1]:33629 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1im5aI-0007jP-5G for submit@debbugs.gnu.org; Mon, 30 Dec 2019 19:40:30 -0500 Original-Received: from mail-oln040092253059.outbound.protection.outlook.com ([40.92.253.59]:6103 helo=APC01-SG2-obe.outbound.protection.outlook.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1im5aF-0007j9-6B for 38807@debbugs.gnu.org; Mon, 30 Dec 2019 19:40:29 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MRnOgrgP7UitziFAXZk3UcyIcbu+RkF1mjpBhM2yB4PkYUx1sQt4LB8YhF/AOxfv61Idt+XVCfgc8CZw13CU1waTz68e7+mxdHbOxehzjpmXpda9R+uL5/4Eks1mJ4/iZhlIqpnW5hdfzn7UpHBgtB7fQ7vbwErAn0uxf8NGvsBhtzzuNv+JE2wjcfy2biroEfetoMpL2qTOAbGWP3HJytuhH3v+rlG1ju00gTak3UDLUnFVX5RPhhyrVE7Kn+CXErkxZ6jRzXTq5d0+Flkvykviw6WvXjtMccUnzxcLd3KAjIkimHM4szV+XCOPodlUGo2LJInGrkByQkix0lsGug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LY25MFrgLRZTE6jszCSlTG+88DQzb/lwQK4Zfw+BeQg=; b=JAu6/whbKh3rsQqV5I6u5IIzzdDlkSx4FsPSN7kUVXMj3QAytlOGg8zGNoft2S2mCli1uiVrkmVtdGaJ76fGmxRPxHZRaLkKgEhmm5U5wsYCR1YPOVw/ViND66mbuXNaULhRlzislF3G1EEFB9MzY2yele74fWFn7PyxT9VffH/EA62zJFYFIjYl981cCBdM1fQtdFK0ULDIiVeaUscjv3iKfRPnC2VfHRzlRcpObvrl/iGckPJrEf0sz6CWiBktV19uRaEiVgoCH/XCM/PV07RKJmi6beWw9y/NZ6nbQRjmkfjY44l+8lg8VjLjp+NCy95EsnPGz18Sa4FmdRJsrw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LY25MFrgLRZTE6jszCSlTG+88DQzb/lwQK4Zfw+BeQg=; b=ZANZ1SMZ6jxPutmHrteLEDNPi+rhkw1VAe6WTPq+XQSDV51+LIulQ4Fn6oh2y29TtlzxUaUEkPgc+N/uUTXa1fmxm3wLEX0jJbzjlkWnQmv8ZTBRCmlCYvwjN6oaygnrTGDiIV4yZF1XXOSo7HP8Gbm0M55TqaalQW6rsAlPlcqNLTyB7ZxYAJlZ6ruX31eRfWWh5q0zaBWUWdgMnQ0U5SShLO+soHpEXE+MHSxtwA4qE5J6AOlaj2ZaX3bdgAyZfPAZCnndHSIIVjofbgoiWtjhwuxjeV142xAcQUgslj+qSZ54rpd+dr8FrgjzlPbqmK9fUN990AZM9habjFJECg== Original-Received: from SG2APC01FT042.eop-APC01.prod.protection.outlook.com (10.152.250.53) by SG2APC01HT023.eop-APC01.prod.protection.outlook.com (10.152.251.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.11; Tue, 31 Dec 2019 00:40:17 +0000 Original-Received: from PS1PR03MB3606.apcprd03.prod.outlook.com (10.152.250.51) by SG2APC01FT042.mail.protection.outlook.com (10.152.251.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.11 via Frontend Transport; Tue, 31 Dec 2019 00:40:17 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:8DD8E3940618507BBD7A1CEEC6CB04BB48EE6786B498165118D08BDF46494D19; UpperCasedChecksum:93912C8E4A491E12EDF0B9F1319FE84A24D8C67488CA32581489E475928719E7; SizeAsReceived:8920; Count:48 Original-Received: from PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b05a:28e4:205a:d7d4]) by PS1PR03MB3606.apcprd03.prod.outlook.com ([fe80::b05a:28e4:205a:d7d4%5]) with mapi id 15.20.2602.010; Tue, 31 Dec 2019 00:40:17 +0000 In-Reply-To: <831rslmxih.fsf@gnu.org> X-Readdle-Message-ID: d9669c10-6f74-4563-a8ba-4351d017002f@Spark X-ClientProxiedBy: HK2PR02CA0207.apcprd02.prod.outlook.com (2603:1096:201:20::19) To PS1PR03MB3606.apcprd03.prod.outlook.com (2603:1096:803:4e::17) X-Microsoft-Original-Message-ID: Original-Received: from [192.168.1.103] (1.196.187.170) by HK2PR02CA0207.apcprd02.prod.outlook.com (2603:1096:201:20::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2581.11 via Frontend Transport; Tue, 31 Dec 2019 00:40:15 +0000 X-Readdle-Message-ID: d9669c10-6f74-4563-a8ba-4351d017002f@Spark X-Microsoft-Original-Message-ID: X-TMN: [Yfvajj0nHKtUKvqE3FtbW4bKI7Ker22W] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 48 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 93f90294-11da-4ea3-864b-08d78d8a0180 X-MS-TrafficTypeDiagnostic: SG2APC01HT023: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HUeo4hhuqWjeHffrvguE18yYKhu20oVHICqXcQWBQqfpFbPSEdyH5hsBfdveX0CiO4tTHQ8H6jMXE4ihmOUMAISVtESj/7GfRYctcT+4PU8rfZMRKvrpnLlVBEoFPLNCK7oG3Bf+xOEVC7ZSR0du9+X7EknA5CYXs4Gy5Ph0PYc9pcnBetJCk1TSCwGdgaPV X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 93f90294-11da-4ea3-864b-08d78d8a0180 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Dec 2019 00:40:17.0485 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2APC01HT023 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173971 Archived-At: --5e0a98ec_2e48f044_4379 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline =E5=9C=A8 2019=E5=B9=B412=E6=9C=8831=E6=97=A5 +0800 AM3:19=EF=BC=8CEli Za= retskii =EF=BC=8C=E5=86=99=E9=81=93=EF=BC=9A > > =46rom: Michael Albinus > > Cc: HaiJun Zhang , 38807=40debbugs.gnu.org > > Date: Mon, 30 Dec 2019 19:31:26 +0100 > > > > The point seems to be that there is a dedicated UI thread. That we do= n't > > have (yet) in Emacs, and I like this idea. > > We do have that on MS-Windows. Except that you'll be surprised how > much of =22UI=22 in Emacs cannot be done in a separate thread, mainly > because the Lisp machine is under such complete control of what the UI > does, and you cannot run several instances of the Lisp machine > simultaneously and asynchronously. What about the following idea: 1. Make the current lisp machine be customized which has two profiles: =C2=A0 =C2=A0 + full featured: as the current running lisp machine in ema= cs =C2=A0 =C2=A0 + subset one: without all UI functions 2. Run the full featured one as emacs does now. It acts as the master lis= p machine(for UI only), which behave like the UI thread(process) in the w= eb browser. 3. Run some subset ones for workers. Workers are started by the master li= sp machine. Workers can send messages to the master machine by calling so= me APIs. The messages are copied to the master lisp machine, so GCs don=E2= =80=99t need to work across machines. 4. Provide some APIs for them to communicate with each other. --5e0a98ec_2e48f044_4379 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline
=E5=9C=A8 2019=E5=B9=B412=E6=9C=8831=E6= =97=A5 +0800 AM3:19=EF=BC=8CEli Zaretskii <eliz@gnu.org>=EF=BC=8C= =E5=86=99=E9=81=93=EF=BC=9A
From: Michael Albinus = <michael.albinus@gmx.de>
Cc: HaiJun Zhang <netjune@outlook.com>, 38807@debbugs.gnu.org
Date: Mon, 30 Dec 2019 19:31:26 +0100

The point seems to be that there is a dedicated UI thread. That we don't have (yet) in Emacs, and I like this idea.

We do have that on MS-Windows. Except that you'll be surprised how
much of "UI" in Emacs cannot be done in a separate thread, mainly=
because the Lisp machine is under such complete control of what the UI
does, and you cannot run several instances of the Lisp machine
simultaneously and asynchronously. 

What about the following idea:
1. Make the current lisp machine be customized which has two profiles:=
    + full featured: as the current running lisp machine= in emacs
    + subset one: without all UI functions
2. Run the full featured one as emacs does now. It acts as the master = lisp machine(for UI only), which behave like the UI thread(process) in the = web browser.
3. Run some subset ones for workers. Workers are started by the master= lisp machine. Workers can send messages to the master machine by calling s= ome APIs. The messages are copied to the master lisp machine, so GCs don=E2= =80=99t need to work across machines.
4. Provide some APIs for them to communicate with each other.

--5e0a98ec_2e48f044_4379--