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: Some experience with the igc branch Date: Mon, 23 Dec 2024 18:44:59 +0200 Message-ID: <86bjx24ad0.fsf@gnu.org> References: <87o713wwsi.fsf@telefonica.net> <87ldw7fwet.fsf@protonmail.com> <87a5cnfj8t.fsf@protonmail.com> <86seqe4j4f.fsf@gnu.org> <87ttaucub8.fsf@protonmail.com> <87pllicrpi.fsf@protonmail.com> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13845"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, ofv@wanadoo.es, emacs-devel@gnu.org, eller.helmut@gmail.com, acorallo@gnu.org To: Pip Cet Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 23 17:45:57 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 1tPlZ7-0003NH-J0 for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Dec 2024 17:45:57 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPlYJ-0007uY-Oe; Mon, 23 Dec 2024 11:45:07 -0500 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 1tPlYI-0007uP-Eb for emacs-devel@gnu.org; Mon, 23 Dec 2024 11:45:06 -0500 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 1tPlYH-00069a-Du; Mon, 23 Dec 2024 11:45:05 -0500 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=9D3FE9DNb8BDSRQNx3Z6ysRyna9DDlHeLbQsy/rBnYA=; b=ionqNaPWHdfJ mog07LYPVnAlySqfJtVWdiRSyaa1S3LuVtbx5n5nUPQcPyeRM6KLiF5ie6/8Vaq3jLfS1+PTrUepn n7sW6kkH1HnoIGphcWEzfsjS0KKcV4dttQOMxDT18OTQnoKT5fPODIbmmVsiN3etnYasqxWyKgrxV JV/aE1zdALtI1UEuIDY+2lUtLwUxrdCfsJ/g49+4Q3+f3+tSX8O+YI+5Aw3F/Q087Et25hj4ClGni f7iYaAbbcJqdEA7VOyI4B0egDrrlTpTaWO5CUuYU/ox4rBV9lyxMD5KHKfjFi0uyhjKbp+MoZIYaZ W7ZQr9hSmYLq0KSsSBuhZA==; In-Reply-To: <87pllicrpi.fsf@protonmail.com> (message from Pip Cet on Mon, 23 Dec 2024 16:03:53 +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:326919 Archived-At: > Date: Mon, 23 Dec 2024 16:03:53 +0000 > From: Pip Cet > Cc: Eli Zaretskii , ofv@wanadoo.es, emacs-devel@gnu.org, eller.helmut@gmail.com, acorallo@gnu.org > > --- a/src/igc.c > +++ b/src/igc.c > @@ -747,19 +747,41 @@ IGC_DEFINE_LIST (igc_root); > > /* Registry entry for an MPS thread mps_thr_t. */ > > +#include We cannot use pthreads.h in portable code. If we want to use threads, we need separate implementations for Posix and Windows, like wedid in systhread.c for Lisp threads. > +struct emacs_ap > +{ > + mps_ap_t mps_ap; > + struct igc *gc; > + pthread_t allocation_thread; pthread_t is non-portable, for the same reasons. > This is the "slow path" only, used for all allocations. Will cause a > great number of busy-looping threads. A lot of threads might be problematic. Each thread reserves memory for its stack, so you end up with lots of reserved memory, and on 32-bit systems can run out of address space. Why do we need this, again?