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 17:59:00 -0400 Message-ID: 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 1253901221 4910 80.91.229.12 (25 Sep 2009 17:53:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 25 Sep 2009 17:53:41 +0000 (UTC) Cc: Giuseppe Scrivano , Emacs development discussions To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 25 19:53:33 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 1MrEz4-0008I8-0L for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 19:53:30 +0200 Original-Received: from localhost ([127.0.0.1]:56801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrEz3-0007D0-Ci for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 13:53:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MrEyz-0007Cs-PC for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:53:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MrEyv-0007CZ-91 for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:53:25 -0400 Original-Received: from [199.232.76.173] (port=33992 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MrEyv-0007CW-6A for emacs-devel@gnu.org; Fri, 25 Sep 2009 13:53:21 -0400 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:35299) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MrEys-0004eE-Pq; Fri, 25 Sep 2009 13:53:18 -0400 Original-Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n8PHrGmm018855; Fri, 25 Sep 2009 13:53:16 -0400 Original-Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id A07BC3A198; Thu, 24 Sep 2009 17:59:00 -0400 (EDT) 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-NAI-Spam-Score: 0.5 X-NAI-Spam-Rules: 2 Rules triggered DATE_IN_PAST_12_24=0.5, RV3371=0 X-NAI-Spam-Level: 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:115625 Archived-At: >>> That's wonderful. Does that mean that Gnus really runs in its own >>> thread while you can do normal editing in other buffers? Giuseppe> Yes, it does (except some errors). I am concentrating all my Giuseppe> efforts on gnus, I think that if threads work well for gnus Giuseppe> they will work quite well with any other package. > This is awesome. Indeed. Giuseppe> At the moment it takes a lot to load folder, because there are Giuseppe> not enough yield on the other thread and probably gnus switch Giuseppe> buffers too often (causing a yield). > 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. Since process filters are currently processed "asynchronously", it would seem like a natural idea would be to create a thread for each process, and let that thread run all the process's filters and sentinels. While I'm here, there's of course another relevant test case: open Emacs on several ttys, and run some long-running commands like indent-region in each (in different buffers at first, and then in the same one, but on different parts of the text, ...). Stefan