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: Wed, 05 Jul 2023 16:33:53 +0300 Message-ID: <837crejxdq.fsf@gnu.org> References: <871qhnr4ty.fsf@localhost> <83v8ezk3cj.fsf@gnu.org> <87v8ezpov0.fsf@localhost> <83r0pnk2az.fsf@gnu.org> <87pm57pns8.fsf@localhost> <83pm57k01f.fsf@gnu.org> <87v8ey8uv7.fsf@localhost> <83bkgqk28a.fsf@gnu.org> <87mt0a8rak.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19146"; 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 Wed Jul 05 15:34: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 1qH2eO-0004lz-62 for ged-emacs-devel@m.gmane-mx.org; Wed, 05 Jul 2023 15:34:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qH2dq-0001Pn-Ta; Wed, 05 Jul 2023 09:33:58 -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 1qH2dp-0001Bc-5V for emacs-devel@gnu.org; Wed, 05 Jul 2023 09:33:57 -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 1qH2do-0002FS-MX; Wed, 05 Jul 2023 09:33:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=PeBCwkgvWmK2E5dj2bqTVbakfYw1/vKx7eruZX+mCow=; b=EcsyVBFPwBP1 5qV3fy5enHS+j36NBe7juLgKqohLfIhn566CZBjHZOEVdzgCN8tzZ6x6Pn46qK9UnZyedWxHUzgOt nGkDmCMJIDp5SwlkxYH/I29AixgyAKMHcMLs07KepCIGVlOJcNXUdUd379xYwdG4YQAhpoJifKxsQ r++wV1laJ8qnZp44VXTyEh3dhOVQxhWqKVuVmZDVLYYcOdsfo15F55h6XY9eN1K9ir08r6WOG/zNq ya+4dB1cLLlnmfe3LOdc3hRJtwOlqN5S+v3zcyRtYTIBxmVrDUyuTjyKrfc2gcm9xWCVYlUZd1bFv KB0ly2SguBCMD7tLft+mTg==; 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 1qH2do-0004Ht-0i; Wed, 05 Jul 2023 09:33:56 -0400 In-Reply-To: <87mt0a8rak.fsf@localhost> (message from Ihor Radchenko on Wed, 05 Jul 2023 12:40:51 +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:307469 Archived-At: > From: Ihor Radchenko > Cc: emacs-devel@gnu.org > Date: Wed, 05 Jul 2023 12:40:51 +0000 > > I imagine that there will be a special "remote Lisp object" type. > > 1. Imagine that child Emacs process asks for a value of variable `foo', > which is a list (1 2 3 4). > 2. The child process requests parent Emacs to put the variable value > into shared memory. > 3. The parent process creates a new variable storing a link to (1 2 3 > 4), to prevent (1 . (2 3 4)) cons cell from GC in the parent process > - `foo#'. Then, it informs the child process about this variable. > 4. The child process creates a new remote Lisp object #. > > 5. Now consider that child process tries (setcar # value). > The `setcar' and other primitives will be modified to query parent > process to perform the actual modification to > (# . (2 3 4)) > > 6. Before exiting the child thread, or every time we need to copy remote > object, # will be replaced by an actual newly created > traditional object. How is this different from communicating via stdout, like we do with start-process today? You don't have to send only textual data via the pipe, you can send binary data stream as well, if what bothers you is the conversion.