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:51:58 -0500 Message-ID: References: <87abbiody1.fsf@master.homenet> <877i6l5d8s.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 1228081940 19203 80.91.229.12 (30 Nov 2008 21:52:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Nov 2008 21:52:20 +0000 (UTC) Cc: rms@gnu.org, 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:53:22 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 1L6uEB-0006tQ-Ft for ged-emacs-devel@m.gmane.org; Sun, 30 Nov 2008 22:53:19 +0100 Original-Received: from localhost ([127.0.0.1]:46619 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6uD1-00010O-6c for ged-emacs-devel@m.gmane.org; Sun, 30 Nov 2008 16:52:07 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L6uCw-00010D-Ul for emacs-devel@gnu.org; Sun, 30 Nov 2008 16:52:03 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L6uCw-000101-Ds for emacs-devel@gnu.org; Sun, 30 Nov 2008 16:52:02 -0500 Original-Received: from [199.232.76.173] (port=58384 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6uCw-0000zy-BO for emacs-devel@gnu.org; Sun, 30 Nov 2008 16:52:02 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:52985) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L6uCt-0000L8-Qx; Sun, 30 Nov 2008 16:51:59 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEANKZMknO+Jkl/2dsb2JhbACBbcsggn2BJA X-IronPort-AV: E=Sophos;i="4.33,691,1220241600"; d="scan'208";a="30453028" 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:51:59 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 8F92584C0; Sun, 30 Nov 2008 16:51:58 -0500 (EST) In-Reply-To: <877i6l5d8s.fsf@master.homenet> (Giuseppe Scrivano's message of "Sun, 30 Nov 2008 18:34:43 +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:106343 Archived-At: > Internal data shared among threads must be accessed only inside critical > sections in the .c code to have atomic operations on it. So what happens when you execute two thread both doing (setq a (1+ a)) if you only do the locking in C, that means that `setq' will be atomic and reading `a' is atomic, but the whole increment is not atomic. As mentioned earlier, synchronization primitives will need to be provided to Elisp. Stefan