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: MPS make-thread Date: Sun, 23 Jun 2024 11:53:14 +0300 Message-ID: <86zfrcdoqt.fsf@gnu.org> References: <87v823xvq1.fsf@localhost> <87frt63dvt.fsf@gmail.com> <86o77ulgk8.fsf@gnu.org> <87zfre1p3r.fsf@gmail.com> <87zfreo5u6.fsf@localhost> <87plsa1n8k.fsf@gmail.com> <87wmmio3vq.fsf@localhost> <87jzii1hbs.fsf_-_@gmail.com> <8734p61evv.fsf@gmail.com> <87cyoa3w5d.fsf@localhost> <87le2whkt2.fsf@localhost> <86sex4g53k.fsf@gnu.org> <864j9kfbm0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2116"; mail-complaints-to="usenet@ciao.gmane.io" Cc: yantar92@posteo.net, eller.helmut@gmail.com, emacs-devel@gnu.org To: Gerd =?iso-8859-1?Q?M=F6llmann?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Jun 23 10:54:11 2024 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 1sLIzB-0000DO-7C for ged-emacs-devel@m.gmane-mx.org; Sun, 23 Jun 2024 10:54:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sLIyO-0005FI-LT; Sun, 23 Jun 2024 04:53:20 -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 1sLIyM-0005F6-Te for emacs-devel@gnu.org; Sun, 23 Jun 2024 04:53:19 -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 1sLIyM-0003N4-HQ; Sun, 23 Jun 2024 04:53:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=CrZqtY5xtiUckImVBjwrIGqhjkHu15i47ejsLZKgHnM=; b=AXDcGDJCRbg2M8ai1lQf npV0HKA1fYcT3PcCejDBvbhBru2BIaJZoc/NK6TpVZapG096fONA7wP7GUEYcYntSqeuQR3o9PpID /R0aq/qvh9w2p5OlE9HGuh/ZxjRlQJrSaja0s0LceLCofBK3tWDveSWcOBB1ScE7zKGERqj9RuFtN jd02khSfdf7uC9W4p0G/sggpQyXOnz7KAJp5l9hckvbAOr+6XoM+bjKqugAN13MLf/D0Nj3t6skrr yE/6g9Pglbds6B6jAoYCtjgbmKi3x+fdYXIKrbaCvoCGV1ugNah69lt3ObAkqI5t5bCJSPzEzE49r 5WmNmMkKaU5Lzw==; In-Reply-To: (message from Gerd =?iso-8859-1?Q?M=F6llmann?= on Sun, 23 Jun 2024 08:45:44 +0200) 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:320503 Archived-At: > From: Gerd Möllmann > Cc: yantar92@posteo.net, eller.helmut@gmail.com, emacs-devel@gnu.org > Date: Sun, 23 Jun 2024 08:45:44 +0200 > > Eli Zaretskii writes: > > > Is it safe to call igc--collect from a non-main Lisp thread? I don't > > understand well the semantics and the intent of what igc_collect does, > > so I cannot myself try to reason about this. Maybe what we do there > > is not safe when invoked from another Lisp thread? Do all our threads > > share the same arena, for example? If so, what happens when a Lisp > > thread is waiting for the global lock and another Lisp thread calls > > igc--collect? > > igc_collect calls mps_arena_collect which acquires the MPS lock, does a > full collection, and leaves the arena in parked state, so that the > caller has to mps_release it itself, which we do in igc_collect. This is > explicitly only intended for debugging purposes. It is thread-safe. Then why did we get the MPS assertion about warm and cold in this case?