From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: advice needed for multi-threading patch Date: Thu, 24 Sep 2009 11:57:28 -0600 Message-ID: References: Reply-To: Tom Tromey NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253815070 16908 80.91.229.12 (24 Sep 2009 17:57:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 17:57:50 +0000 (UTC) Cc: Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 24 19:57:43 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MqsZb-0004M5-1q for ged-emacs-devel@m.gmane.org; Thu, 24 Sep 2009 19:57:43 +0200 Original-Received: from localhost ([127.0.0.1]:42165 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqsZa-0003qr-N6 for ged-emacs-devel@m.gmane.org; Thu, 24 Sep 2009 13:57:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqsZW-0003qk-Gd for emacs-devel@gnu.org; Thu, 24 Sep 2009 13:57:38 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqsZR-0003pk-C2 for emacs-devel@gnu.org; Thu, 24 Sep 2009 13:57:37 -0400 Original-Received: from [199.232.76.173] (port=58005 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqsZR-0003ph-83 for emacs-devel@gnu.org; Thu, 24 Sep 2009 13:57:33 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:37657) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MqsZQ-00062c-Lp for emacs-devel@gnu.org; Thu, 24 Sep 2009 13:57:32 -0400 Original-Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n8OHvUWE005458; Thu, 24 Sep 2009 13:57:31 -0400 Original-Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8OHvUdv031137; Thu, 24 Sep 2009 13:57:30 -0400 Original-Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n8OHvTRr028410; Thu, 24 Sep 2009 13:57:29 -0400 Original-Received: by opsy.redhat.com (Postfix, from userid 500) id AEE7A378185; Thu, 24 Sep 2009 11:57:28 -0600 (MDT) X-Attribution: Tom In-Reply-To: (Stefan Monnier's message of "Thu, 24 Sep 2009 13:25:03 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:115587 Archived-At: >>>>> "Stefan" == Stefan Monnier writes: Tom> Yeah. What I meant here is that specbind has a little extra code in it Tom> to install a Lisp_ThreadLocal object when needed. So, if the C code Tom> uses specbind to do let-like binding, everything will work fine. If the Tom> C code does not do this, then things will break. Stefan> I see, yes of course it's a problem. And it's worse than that: the same Stefan> holds for *all* global variables, whether they are exported to Lisp Stefan> or not. Yes. We move a bunch of globals into a "struct thread_state" -- specpdl stuff, gcprolist, catchlist, etc. I haven't yet done an audit of globals to see whether we caught them all. These are also redefined using the preprocessor, e.g.: /* Recording what needs to be marked for gc. */ struct gcpro *m_gcprolist; #define gcprolist (current_thread->m_gcprolist) Stefan> Some goals could be: [...] Thanks. That is very helpful. I will think about your other points and reply later. Tom