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 21:24:12 +0300 Message-ID: <83pm57k01f.fsf@gnu.org> References: <871qhnr4ty.fsf@localhost> <83v8ezk3cj.fsf@gnu.org> <87v8ezpov0.fsf@localhost> <83r0pnk2az.fsf@gnu.org> <87pm57pns8.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29657"; 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 20:25:15 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 1qGkiB-0007Sc-2g for ged-emacs-devel@m.gmane-mx.org; Tue, 04 Jul 2023 20:25:15 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qGkhH-00028M-BW; Tue, 04 Jul 2023 14:24:19 -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 1qGkhF-00027u-3e for emacs-devel@gnu.org; Tue, 04 Jul 2023 14:24:17 -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 1qGkhE-0007tK-GS; Tue, 04 Jul 2023 14:24:16 -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=Fp4srAHD7/YD7OAImXuba7zm4lir49gniougIEuJzmU=; b=Zow990UXiBX2 b+GznatmtBOf2oQkojUkVQ4aCEMTfQPH93Sb0PXUHyw37X5E8R0ksNsGQX5mWsQ/MixFQ1f8q8gHA dMHRL+0i1NbEu/6TiEmi5eQD5XB7vQOeXp96hw4c6roJ+8gp1dozmaIrJl7gRJzaukQ6TsLELx4RL Xctz7SfA+4lLr8qxSkqAjgKmOLnLNiWzgB9zpSzz+MHOXfc/4mh+OdJZ6AcM5FSSa/F8YjilcuM3z 81OAmNbk7TqcMKDql2pRXubYyGkysGJAoKZKHTHL3fWH82yzvAuN2jHTL4L5LgV8v96smdbWsKpaB xK8UbpFAnTA7e0OgMn+5Yw==; 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 1qGkhE-000503-04; Tue, 04 Jul 2023 14:24:16 -0400 In-Reply-To: <87pm57pns8.fsf@localhost> (message from Ihor Radchenko on Tue, 04 Jul 2023 17:52:23 +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:307440 Archived-At: > From: Ihor Radchenko > Cc: emacs-devel@gnu.org > Date: Tue, 04 Jul 2023 17:52:23 +0000 > > Eli Zaretskii writes: > > >> As the first step, I wanted to hear if there is any blocker that > >> prevents memcpy between processes without going through print/read. > > > > I don't think you can design on this base. Security and all that. > > But why is it a problem? I'm not an expert, but AFAIK reading from, and writing to, the memory of another process is something allowed basically only for debuggers. And how would you know the address in another process anyway, given today's ASLR techniques? > Isn't it normal for a C++ thread to get pointer to the parent heap? That's inside the same process: a huge difference. > > Also, complex structures include pointers and references, which you > > cannot safely copy as-is anyway. > > May you please elaborate? For example, a list whose member is a string includes a pointer to that string's data. > >> IMHO, the main problem with threads is that they cannot be interrupted > >> or fire too frequently. > > > > I wish this were the only problem with threads. > > Maybe. But I haven't seen other problems preventing threads from being used. I have, too many of them. Some are semi-fixed, but I'm afraid we only don't hear about them because threads are not used in serious, production-quality programs.