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: advice needed for multi-threading patch Date: Thu, 24 Sep 2009 13:29:31 -0400 Message-ID: References: <87zl8lwlgl.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 1253813394 11109 80.91.229.12 (24 Sep 2009 17:29:54 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 17:29:54 +0000 (UTC) Cc: Tom Tromey , Emacs development discussions To: Giuseppe Scrivano Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Sep 24 19:29:47 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 1Mqs8Z-0003tA-47 for ged-emacs-devel@m.gmane.org; Thu, 24 Sep 2009 19:29:47 +0200 Original-Received: from localhost ([127.0.0.1]:53795 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqs8Y-0000vj-JD for ged-emacs-devel@m.gmane.org; Thu, 24 Sep 2009 13:29:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mqs8T-0000vL-LQ for emacs-devel@gnu.org; Thu, 24 Sep 2009 13:29:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mqs8P-0000uF-E5 for emacs-devel@gnu.org; Thu, 24 Sep 2009 13:29:41 -0400 Original-Received: from [199.232.76.173] (port=43611 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqs8P-0000uC-5n for emacs-devel@gnu.org; Thu, 24 Sep 2009 13:29:37 -0400 Original-Received: from chene.dit.umontreal.ca ([132.204.246.20]:43817) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mqs8M-0000I7-ER; Thu, 24 Sep 2009 13:29:35 -0400 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by chene.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n8OHTWci022750; Thu, 24 Sep 2009 13:29:32 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id ED46B3A122; Thu, 24 Sep 2009 13:29:31 -0400 (EDT) In-Reply-To: <87zl8lwlgl.fsf@master.homenet> (Giuseppe Scrivano's message of "Wed, 23 Sep 2009 20:43:38 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3370=0 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:115586 Archived-At: > As Tom said, I was experimenting with gnus and it made me quite > optimistic; in fact these commands are completed successfully: > (run-in-thread '(gnus) t) ;; with t the thread doesn't attempt to get > ;; a lock on the buffer. > (while (yield)) ;; yield returns nil when there are not other > ;; threads -- simulate join. That's wonderful. Does that mean that Gnus really runs in its own thread while you can do normal editing in other buffers? > Following your advice to don't allow a switch only when buffer-local > variables are let-bound by the thread, how many times it happens than a > thread let-bound these variables? Let's say on 100 times, how many > times approximately do you think a switch will not be allowed and the > calling thread blocked? I have no idea. I don't think the number of such situations (counted dynamically) is very important. What matters is the number of places in the source code where this is problematic. Stefan