From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Concurrency via isolated process/thread Date: Tue, 04 Jul 2023 20:12:44 +0300 Message-ID: <83v8ezk3cj.fsf@gnu.org> References: <871qhnr4ty.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19997"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jul 04 19:13:32 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qGjak-00051d-GX for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jul 2023 19:13:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGjaA-0005DU-Q9; Tue, 04 Jul 2023 13:12:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGja5-00055V-Rd for emacs-devel@gnu.org; Tue, 04 Jul 2023 13:12:49 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGja5-0001P3-J4; Tue, 04 Jul 2023 13:12:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=WjCvVPIxOvrirre2cpkpw2s11OISWvF7caQCCKq8ffw=; b=fRhHfFq2C2IJ6BP7Aw4m +eSvcFBK/U2JIsDDpuEH9vRJ/GgsR1kGMJVyE24/X7Q6/caLNPtD2O/KapOaXO5Bf/2UcjKk9aSF4 GbzC/tITrCHC2yMuZc2OE5DKGSfVuus7MTGl7MDY1jVJzSl2afj6wdKRjZWk5dnecsRPV8jsE+Mtl Bxq8PeeTspLTIh7Vjj8fEZrP+9hjvYGQ/LBEcrRpBeFFePteWyggJ/SJAZyjUBKAVZaFRCNI7ZSOg 9k1ZfN6IfDwM296OfGikZCgWQi3YJmBHgkkcxpPhAl/6aNbhq1B1cJbwuEAx+l+IGC2Nqn2ux18nm T8L9odzaujUMKw==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qGja3-00030N-VM; Tue, 04 Jul 2023 13:12:48 -0400 In-Reply-To: <871qhnr4ty.fsf@localhost> (message from Ihor Radchenko on Tue, 04 Jul 2023 16:58:49 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307433 Archived-At: > From: Ihor Radchenko > Date: Tue, 04 Jul 2023 16:58:49 +0000 > > emacs-async package explicitly transfers pre-defined set of variables to > the async Emacs process and cannot transfer non-printable variables > (like markers or buffers). > > But may it be possible to > > 1. Limit the async process memory to a small lexical subset of symbols > (within a function). > > 2. Every time the async process needs to read/write a symbol slot > outside its lexical scope, query the main Emacs process. If it queries the main process, it will have to wait when the main process is busy. So this is not really asynchronous. > More concretely, is it possible to copy internal Elisp object > representations between Emacs processes and arrange mutability to query > the right Emacs process that "owns" the object? This is software: anything's possible ;-). But Someoneā„¢ needs to write the code, like marshalling and unmarshalling of such objects between two processes. (We do something like that when we write then load the pdumper file.) There's more than one way of skinning this particular cat. > The inter-process communication does not have to be asynchronous, but > may work similar to the existing thread implementation. I wouldn't recommend designing anything by the example of Lisp threads. 'Nough said.