From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu Newsgroups: gmane.emacs.devel Subject: Re: Concurrency via isolated process/thread Date: Fri, 07 Jul 2023 21:31:16 +0800 Message-ID: <87ilavhmqj.fsf@yahoo.com> References: <871qhnr4ty.fsf@localhost> <83v8ezk3cj.fsf@gnu.org> <87v8ezpov0.fsf@localhost> <83r0pnk2az.fsf@gnu.org> <87pm57pns8.fsf@localhost> <87lefvp55t.fsf@yahoo.com> <87sfa28ura.fsf@localhost> <87cz16o8vz.fsf@yahoo.com> <87jzve8r4m.fsf@localhost> <871qhmo5nv.fsf@yahoo.com> <87bkgq8p5t.fsf@localhost> <831qhmjwk0.fsf@gnu.org> <875y6y8nlr.fsf@localhost> <87h6qhnalc.fsf@yahoo.com> <87ilax71wo.fsf@localhost> <831qhli14t.fsf@gnu.org> <87wmzdxewc.fsf@localhost> <83r0plgjeo.fsf@gnu.org> <87o7kpxapo.fsf@localhost> <87ilawimdq.fsf@yahoo.com> <87ttufc2pr.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9022"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jul 07 15:32:45 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 1qHlZl-000283-3T for ged-emacs-devel@m.gmane-mx.org; Fri, 07 Jul 2023 15:32:45 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qHlYn-0004SU-1d; Fri, 07 Jul 2023 09:31:45 -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 1qHlYb-0004Nz-Lh for emacs-devel@gnu.org; Fri, 07 Jul 2023 09:31:38 -0400 Original-Received: from sonic301-31.consmr.mail.ne1.yahoo.com ([66.163.184.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qHlYW-0001df-PI for emacs-devel@gnu.org; Fri, 07 Jul 2023 09:31:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1688736686; bh=pbVCTpCKD9faH5FyJ2JLkmXn9zZwlFnYpynogv0RRDE=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=rG/yLPjw32dXygrIsC9mWARo0j+QQEZvSaVFzlaKWh3O+ph3aUn292BrUUEbq99GNRNJ7VMaOh0dHtkM0oIyaPge1JLut3x6Bbn3oEwlaYnfS+vOQNmXLMJHZU4J1Hz1IKBkNggetQwoStjR+H2P1BVILDtDykKS29P3QzpZjW2N4pUZ4rh7jhVaAcIUzn/Q3pT4clgwGEojWHNeHKBxIYiFVrpsAZwMKYX/qhbr+nrI6PyvWmaVXrQtI+gvk1H2qKWGRuOgW3g7h5TwVXyZIe3smHFHJrjUDkclpOHFMAbz4DY1Mj+AQHgAa6xM6WlVJPUhbgZcRR4AhWvVrX2K4A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1688736686; bh=3tsS/yQHob4wEZGCD7MTbcaPC6bkDBcQSKmddleo7jd=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=VNEE/9eo1Y/WveiP7QRrLjQg1XaChcx3op1NLvj5gZx48/c1TLUtH2h049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cpuh51.ekWkaJuuWJ3kSN7Wa1nZKw3dLjB2KnCVW4yuT5vZ2YrCKZwJ0VNFn31 zWb.ZmCxOtCBhaEj8XcQOstHQzaHP1CrvIimmUNDBq X-Sonic-MF: X-Sonic-ID: abca3980-1bb1-4fe7-b26b-3e7556fd0da8 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic301.consmr.mail.ne1.yahoo.com with HTTP; Fri, 7 Jul 2023 13:31:26 +0000 Original-Received: by hermes--production-sg3-67fd64777-srcqr (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 4e19c0b44fcc3505d38bd97ddc93b956; Fri, 07 Jul 2023 13:31:21 +0000 (UTC) In-Reply-To: <87ttufc2pr.fsf@localhost> (Ihor Radchenko's message of "Fri, 07 Jul 2023 12:42:40 +0000") X-Mailer: WebService/1.1.21638 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.184.200; envelope-from=luangruo@yahoo.com; helo=sonic301-31.consmr.mail.ne1.yahoo.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NEUTRAL=0.779, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:307570 Archived-At: Ihor Radchenko writes: > Po Lu writes: > >> Ihor Radchenko writes: >> >>> Same with variables - even if some global variable needs to be locked, >>> it is unlikely that it will need to be accessed by another thread. >> >> I doubt symbol value cells will need to be individually interlocked. >> Emacs Lisp code will need to insert the appropriate instructions to >> prevent the CPU from undertaking optimizations on load and store >> operations on those cells when necessary. ... > > I had a different simple scenario in mind: > > (let ((oldval case-fold-search)) > (unwind-protect > (progn (setq case-fold-search nil) > ;; We surely do not want the value of `case-fold-search' to be > ;; changed in the middle of `expensive-computation'. > (expensive-computation)) > (setq case-fold-search oldval)) That's easy: case-fold-search can be made local to each thread.