From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giuseppe Scrivano Newsgroups: gmane.emacs.devel Subject: Re: advice needed for multi-threading patch Date: Fri, 25 Sep 2009 00:23:04 +0200 Message-ID: <87ocp07zjr.fsf@master.homenet> References: <87zl8lwlgl.fsf@master.homenet> <87ocp0w4vx.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 1253831082 6156 80.91.229.12 (24 Sep 2009 22:24:42 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 22:24:42 +0000 (UTC) Cc: Stefan Monnier , Emacs development discussions To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 25 00:24:35 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 1Mqwjp-0001tX-Ak for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 00:24:33 +0200 Original-Received: from localhost ([127.0.0.1]:48131 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqwjo-0008QH-D5 for ged-emacs-devel@m.gmane.org; Thu, 24 Sep 2009 18:24:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mqwjj-0008Q9-ID for emacs-devel@gnu.org; Thu, 24 Sep 2009 18:24:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mqwje-0008PP-5a for emacs-devel@gnu.org; Thu, 24 Sep 2009 18:24:26 -0400 Original-Received: from [199.232.76.173] (port=42294 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqwje-0008PM-0B for emacs-devel@gnu.org; Thu, 24 Sep 2009 18:24:22 -0400 Original-Received: from averell.mail.tiscali.it ([213.205.33.55]:47588) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mqwjc-0001Wc-ET; Thu, 24 Sep 2009 18:24:20 -0400 Original-Received: from master.homenet (84.222.168.3) by averell.mail.tiscali.it (8.0.022) id 4AA780C8006A7274; Fri, 25 Sep 2009 00:24:06 +0200 Original-Received: from gscrivano by master.homenet with local (Exim 4.69) (envelope-from ) id 1MqwiO-0002QF-SC; Fri, 25 Sep 2009 00:23:04 +0200 In-Reply-To: (Tom Tromey's message of "Thu, 24 Sep 2009 14:04:22 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) 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:115598 Archived-At: Tom Tromey writes: > I think we need to yield when a thread is waiting for I/O. And, we > probably need a way to associate a process filter with a thread, so that > whatever input Gnus gets is processed in the right thread. I did some changes today. Now a thread exits from the global lock before calls `select' and it enters again immediately after `select' returns, leaving other threads free to do their job. Blocking operations affect only the caller thread. As direct effect, now this is enough: (run-in-thread '(gnus)) and gnus will be loaded in the background, without explicitly call `yield'. Cheers, Giuseppe