From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: multi-threaded Emacs Date: Sun, 30 Nov 2008 16:46:35 -0500 Message-ID: References: <87abbiody1.fsf@master.homenet> <873ahant5l.fsf@master.homenet> <87bpvx5tw1.fsf@master.homenet> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228081629 18256 80.91.229.12 (30 Nov 2008 21:47:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2008 21:47:09 +0000 (UTC) Cc: emacs-devel@gnu.org To: Giuseppe Scrivano Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 30 22:48:12 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 1L6u94-0005Vd-Qu for ged-emacs-devel@m.gmane.org; Sun, 30 Nov 2008 22:48:03 +0100 Original-Received: from localhost ([127.0.0.1]:41440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6u7u-0006Sy-FD for ged-emacs-devel@m.gmane.org; Sun, 30 Nov 2008 16:46:50 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6u7p-0006Qn-EV for emacs-devel@gnu.org; Sun, 30 Nov 2008 16:46:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6u7n-0006QS-5N for emacs-devel@gnu.org; Sun, 30 Nov 2008 16:46:44 -0500 Original-Received: from [199.232.76.173] (port=51507 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6u7n-0006QN-0Z for emacs-devel@gnu.org; Sun, 30 Nov 2008 16:46:43 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:26675 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L6u7l-00075m-9n; Sun, 30 Nov 2008 16:46:41 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAKKYMknO+Jkl/2dsb2JhbACBbcsegn2BJA X-IronPort-AV: E=Sophos;i="4.33,691,1220241600"; d="scan'208";a="30452961" Original-Received: from 206-248-153-37.dsl.teksavvy.com (HELO pastel.home) ([206.248.153.37]) by ironport2-out.teksavvy.com with ESMTP; 30 Nov 2008 16:46:35 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 7280384C0; Sun, 30 Nov 2008 16:46:35 -0500 (EST) In-Reply-To: <87bpvx5tw1.fsf@master.homenet> (Giuseppe Scrivano's message of "Sun, 30 Nov 2008 12:35:10 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) 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:106342 Archived-At: > I don't think that thread-local data has the same meaning as > buffer-local, frame-local or terminal-local. Indeed. But the implementation may use the same code (to a large extent at least). > Do you see any situation that there is need to store a value on a > specific thread? let-binding, of course. It's probably the only one that matters (besides the internal ones like current_buffer). >> I'm not sure what you mean by "a global lock". The question is not only >> how many locks, but what they protect. My proposal further down to >> start with "only one thread active at a time" is what I'd call "a global >> lock". > If we use a lock (or locks) to protect shared data still threads can be > executed in parallel while they working on thread local data. That basically means adding lock&unlock around `symbol-value' and pretty much every primitive. I expect this will take a significant amount of work, will lead to a significant performance hit, and will not expose much parallelism, if any. Stefan