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: multi-threaded Emacs Date: Sat, 29 Nov 2008 15:06:09 -0700 Message-ID: References: <87abbiody1.fsf@master.homenet> 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 1227996444 9429 80.91.229.12 (29 Nov 2008 22:07:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 29 Nov 2008 22:07:24 +0000 (UTC) Cc: Giuseppe Scrivano , emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Nov 29 23:08:05 2008 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 1L6XyZ-0007mn-J7 for ged-emacs-devel@m.gmane.org; Sat, 29 Nov 2008 23:07:43 +0100 Original-Received: from localhost ([127.0.0.1]:33597 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6XxP-0003KN-5b for ged-emacs-devel@m.gmane.org; Sat, 29 Nov 2008 17:06:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6XxI-0003Jy-AE for emacs-devel@gnu.org; Sat, 29 Nov 2008 17:06:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6XxG-0003JY-Sy for emacs-devel@gnu.org; Sat, 29 Nov 2008 17:06:23 -0500 Original-Received: from [199.232.76.173] (port=49281 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6XxG-0003JV-OA for emacs-devel@gnu.org; Sat, 29 Nov 2008 17:06:22 -0500 Original-Received: from mx2.redhat.com ([66.187.237.31]:51889) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L6XxF-0007Ia-8a; Sat, 29 Nov 2008 17:06:21 -0500 Original-Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id mATM6FjO001349; Sat, 29 Nov 2008 17:06:17 -0500 Original-Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id mATM6CGh021953; Sat, 29 Nov 2008 17:06:12 -0500 Original-Received: from opsy.redhat.com (vpn-12-76.rdu.redhat.com [10.11.12.76]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id mATM6B06009765; Sat, 29 Nov 2008 17:06:11 -0500 Original-Received: by opsy.redhat.com (Postfix, from userid 500) id 5335A8880B8; Sat, 29 Nov 2008 15:06:10 -0700 (MST) X-Attribution: Tom In-Reply-To: (Stefan Monnier's message of "Sat\, 29 Nov 2008 15\:26\:21 -0500") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:106324 Archived-At: >>>>> "Stefan" == Stefan Monnier writes: Stefan> - handling thread-specific data: gcprolist, mark_byte_stack, and things Stefan> like that. You've tackled this one. I don't find your solution very Stefan> elegant, but I can't think of a much better one, unless pthreads does Stefan> provide some kind of thread-specific variables. pthreads provides the clunky pthread_getspecific / pthread_setspecific API. However, it is worth noting that recent versions of GCC support a __thread storage class, which provides efficient support for thread-local variables. IMO, for anything that is performance sensitive, it is worth structuring the code so that this can be used. See (info "(gcc)Thread-Local") Tom