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: Mon, 17 Jul 2023 18:08:19 +0800 Message-ID: <878rbe7svg.fsf@yahoo.com> References: <871qhnr4ty.fsf@localhost> <83edljg8ub.fsf@gnu.org> <87o7knbxr7.fsf@localhost> <838rbrg4mg.fsf@gnu.org> <87ilavbvdr.fsf@localhost> <834jmffvhy.fsf@gnu.org> <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> <87y1jf29a4.fsf@localhost> <878rbf0y6b.fsf@localhost> <87h6q36ijw.fsf@yahoo.com> <875y6i2a3n.fsf@localhost> <87cz0q7u71.fsf@yahoo.com> <87o7kazwvc.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="35601"; 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 Mon Jul 17 12:09:22 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 1qLLAP-00091g-Uh for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Jul 2023 12:09:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qLL9f-000855-GQ; Mon, 17 Jul 2023 06:08:35 -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 1qLL9d-00084X-9x for emacs-devel@gnu.org; Mon, 17 Jul 2023 06:08:33 -0400 Original-Received: from sonic306-20.consmr.mail.ne1.yahoo.com ([66.163.189.82]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qLL9b-0003a0-G0 for emacs-devel@gnu.org; Mon, 17 Jul 2023 06:08:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1689588508; bh=28Ky8cxHi3oUsMU+c08C3Jkaet19fXY5LdV1CU5ciNQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=iuq4gPd9dsA8zcNS6sEJ//kthK7tiGU5KeNgkuceGcUkz7CThiIrZvtdRGxt9YW7/IcB8KPCilrYTjY59NwYuXqdfQWH/K7wO0HmR/7Qjmxi3/B/KSZcuWP2kAqHTInggYNBpOOaIda1YMAiZQUiRkrBq1gFLKQUys+gjr4vc9/Kwu0XHyp1IgCXyva8JXZhOi6bd+CR3xzMUr0YkZ9XErT69EAOVw3H5NKnvOonspAUrPmr9K+DQahXSOFD0A1EvPfvSINGyJAVyt4jQxzet6TNfkjBmTFO3l1X0KIfdK3uu5VUOD/4cy39qMnxpbrdGYcR/E8LSrgUYHSrCWSK+A== X-SONIC-DKIM-SIGN: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1689588508; bh=RacYBkrBNuWr0KmTLQ4HvUFwkrY678Oqr2GRU6QNmMS=; h=X-Sonic-MF:From:To:Subject:Date:From:Subject; b=Q+7coQjD8swW1pnIDI5MjpTHZbzZ82XvHSV6eIn98rwMy8huDmANGd3w1dbNedbneFX+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28PajP2tme0h.GsqQo NO.bi5pMGwVxBY9RGMZFFf107f_ozMDLlobmIrbnAM X-Sonic-MF: X-Sonic-ID: 59d542fd-4953-4316-91a0-959b20d5b3ba Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic306.consmr.mail.ne1.yahoo.com with HTTP; Mon, 17 Jul 2023 10:08:28 +0000 Original-Received: by hermes--production-sg3-67fd64777-txbf9 (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 02155a8a9e0fd897789b5034a8e9f4ce; Mon, 17 Jul 2023 10:08:25 +0000 (UTC) In-Reply-To: <87o7kazwvc.fsf@localhost> (Ihor Radchenko's message of "Mon, 17 Jul 2023 09:54:31 +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.189.82; envelope-from=luangruo@yahoo.com; helo=sonic306-20.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=unavailable 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:307923 Archived-At: Ihor Radchenko writes: > GCALIGNED_UNION_MEMBER Its purpose is to ensure that Lisp structures are aligned sufficiently for mark_memory to locate its members when they are placed on the stack, through the optional AUTO_CONS or AUTO_STRING mechanism. > What I mean is a situation when we try to read sym->u.s.val.value, but > the value becomes Lisp_Object value[]. > > Then, realloc calls in other thread may create a race condition when > accessing array element may point to obsolete memory address that was > only valid prior to realloc. My implementation used a lock around a linked list of value and function cells, only taken if the thread sees that the list is not empty.