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: Tue, 25 Jul 2023 16:27:20 +0800 Message-ID: <87351cz993.fsf@yahoo.com> References: <871qhnr4ty.fsf@localhost> <878rbrbmwr.fsf@localhost> <83fs5zecpo.fsf@gnu.org> <87351zbi72.fsf@localhost> <83351yevde.fsf@gnu.org> <87cz12ad2w.fsf@localhost> <83a5w6cwdr.fsf@gnu.org> <87pm518m0g.fsf@localhost> <83o7kl9tyj.fsf@gnu.org> <874jmd89us.fsf@localhost> <878rb53dkj.fsf@localhost> <83edkxsclz.fsf@gnu.org> <87tttt1mzh.fsf@localhost> <83351ds9de.fsf@gnu.org> <87ila91j6n.fsf@localhost> <83y1j5qoyo.fsf@gnu.org> <87wmypi7s0.fsf@localhost> <87fs5czvs2.fsf@yahoo.com> <87mszk7glc.fsf@localhost> <877cqozc14.fsf@yahoo.com> <87bkg0s9p4.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="40877"; 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 Tue Jul 25 10:28:20 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 1qODP2-000ANa-AW for ged-emacs-devel@m.gmane-mx.org; Tue, 25 Jul 2023 10:28:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qODOM-0005EV-6b; Tue, 25 Jul 2023 04:27:38 -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 1qODOK-0005EN-Kt for emacs-devel@gnu.org; Tue, 25 Jul 2023 04:27:36 -0400 Original-Received: from sonic317-34.consmr.mail.ne1.yahoo.com ([66.163.184.45]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qODOH-0001hI-2q for emacs-devel@gnu.org; Tue, 25 Jul 2023 04:27:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1690273650; bh=4AjQ6rcqydbutWwQxjNuleS42nobvm+01Ff969ZKD/M=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=XMgfT3gI3MAagUJ0s97EgQ7U6Rp9Wfo3qE+LLR57x/uqc/0PoKksTSwtaYy0pEiikwW3BCKno2vrPMIq31HeA/OEGgu0/Zhmvr8gouQxNdCOGCfFKgIuxoe3wHLWeHq2/5oy1xh6hy8tENT01R8YxiGuz3xi7BooSxb1TCQu3M9wVwnYrofleuWJ5YVjq+KjBx5SVsJ2wD3nYduAIj+k806Dy2g+l4mQboIKYHkLnFkV9JXUGB3osM06z/vE3n5oQcsPDTr0WNikkUJAgTmkb1Im2qUo0OzsO6/WXIoWjvnj/r3ftucs2RapJyQj4TfFlRfdwBL5IjyC145ecEz/fw== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1690273650; bh=A5HK6cAroAWzlydBcQqr/O3aykCS+Rz90/io8cCvYb0=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=BfwpGClDkZYvC/k37wL+9T2JB0L+XyBYESrmRo+XNGLzTT5aKKGPQS5UYa+DrloQva2x3n8fGm2y/j37a2s9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3D9 YVuRREZuA5RLmHIwxRhvZjCmQeF4ZBXevyOdu1EZ0S X-Sonic-MF: X-Sonic-ID: 712958e1-0586-4059-b58a-757ddef40c52 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic317.consmr.mail.ne1.yahoo.com with HTTP; Tue, 25 Jul 2023 08:27:30 +0000 Original-Received: by hermes--production-sg3-6b8fc8d58f-t7fng (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 7bca8ea58322ef047d9975c2609629b5; Tue, 25 Jul 2023 08:27:26 +0000 (UTC) In-Reply-To: <87bkg0s9p4.fsf@localhost> (Ihor Radchenko's message of "Tue, 25 Jul 2023 07:59:35 +0000") X-Mailer: WebService/1.1.21647 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo Received-SPF: pass client-ip=66.163.184.45; envelope-from=luangruo@yahoo.com; helo=sonic317-34.consmr.mail.ne1.yahoo.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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:308079 Archived-At: Ihor Radchenko writes: > McKenney (2023) Is Parallel Programming Hard, And, If So, What Can You > Do About It? p. 483 > > "For an example, consider > embedded systems with 32-bit pointers and 16-bit busses. > On such a system, a data race involving a store to and a > load from a given pointer might well result in the load > returning the low-order 16 bits of the old value of the > pointer concatenated with the high-order 16 bits of the > new value of the pointer." Emacs supports such systems? And they are SMPs as well? > Sure. I just meant that we need to avoid data races. Again, there are NO data races on systems Emacs supports. > Using READ/WRITE_ONCE or mutexes. So nothing needs to be done. > READ/WRITE_ONCE should be actually avoided Because on the hypothetical systems that Emacs will need to support in the future _and_ do not coherently propagate word sized writes between CPUs, they must be implemented with interlocking, either in hardware or in software. Mutexes, of course, will then need to be implemented on top of that. > AFAIK. They will degrade > performance significantly (one-two orders of magnitude) for each > individual operation (see Figure 5.1 in the McKenney's book) Figure 5.1 in that book illustrates the scalability of x86 interlocked instructions by comparing an increment mechanism using plain loads and stores to an atomic increment mechanism. It is not relevant to the subject at hand.