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: weak hash tables Date: Sat, 06 Jul 2024 14:03:55 +0300 Message-ID: <86jzhy4w9w.fsf@gnu.org> References: <878qyf4sgm.fsf@gmail.com> <4JQ7mGAwBrGOLmq0SzqnMOSkzoEFxTOfGHxGzJ8fa48FMVlfasV4QTPgE3E8yidy4XXamrIt3gg9Lv_TSJkOO5IIz4VDmygEtBAEsvhIusM=@protonmail.com> <86le2f5874.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27631"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, eller.helmut@gmail.com, emacs-devel@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 06 13:04:26 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 1sQ3DN-0006wc-JQ for ged-emacs-devel@m.gmane-mx.org; Sat, 06 Jul 2024 13:04:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sQ3D2-0005UV-06; Sat, 06 Jul 2024 07:04:04 -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 1sQ3Cz-0005Tw-Gx for emacs-devel@gnu.org; Sat, 06 Jul 2024 07:04:01 -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 1sQ3Cz-0006Jo-7e; Sat, 06 Jul 2024 07:04:01 -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=39Ja2SU0Q0LiTq6wF8LsmXlUhNqStVyVqreXOuWVHpQ=; b=SYThceecYUi0 SzONG7NmC6DtU6wSimSYCJdpo9WVNCnJom8JUJn+Dfu/tbCj1VNCBkZX0CXOuOTA8e4vlgJkCIjQ6 6LyFAhVV6SXNaIEzRZIzJg63WbThVpx9dk3ubjAHoqOmrUf+2Q2XYH3qznwLnuyvll2bBeO06ByOp 1z6CbadvOhKmY01y2BJNvv+053rS2i/2K4vzPf7+fh1ebYygVedwbKKvt8Qg8DTH+rmxJfTw0ssCN RYOTM2IredMY/l3iT1ygLrlvHsJo4wmMNveTzbkFb1BIt9s6N3XTjqr2JvJfsQC+USVBiYkh1TUJb s2mJNPmU5tY3q16SgKuIAw==; In-Reply-To: (message from Pip Cet on Sat, 06 Jul 2024 09:23:27 +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:321421 Archived-At: > Date: Sat, 06 Jul 2024 09:23:27 +0000 > From: Pip Cet > Cc: gerd.moellmann@gmail.com, eller.helmut@gmail.com, emacs-devel@gnu.org > > On Saturday, July 6th, 2024 at 06:46, Eli Zaretskii wrote: > > Thanks, but why is this important or interesting? We are not going to > > add native threads to Emacs. > > We do want other threads to be able to access MPS-managed memory, don't we? We do? Do you mean Lisp threads (created via make-thread)? Those run via a different machinery, and should be registered with MPS. > And the bugs it has caught so far were actual bugs. I believe this is true even for the specpdl thing, though we could avoid that by trusting our thread data more. You could easily be led astray with this code, since AFAIU it doesn't work like Emacs should be working. > > Also, AFAIU, MPS docs says to register each thread with it, and your > > code doesn't, AFAICT. > > It needs to be registered as a root if it is one. This one isn't. It also needs to be able to be suspended, but on pthreads that's handled automatically. I have no idea what that means and why it is true, but then I don't understand MPS well enough. > You're correct, though, that it's possible this will crash on code that can't actually crash without the extra thread. We need to look at each crash and decide whether it is. Why not try first the code that will definitely run in Emacs and should work correctly? Once that is solved, we can later go to more exotic test cases.