From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ken Raeburn Newsgroups: gmane.emacs.devel Subject: Re: advice needed for multi-threading patch Date: Thu, 24 Sep 2009 18:47:16 -0400 Message-ID: <01251CA0-E169-4DCF-A65A-DF9ED0FEDFFC@raeburn.org> References: <87zl8lwlgl.fsf@master.homenet> <87ocp0w4vx.fsf@master.homenet> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1253832484 10050 80.91.229.12 (24 Sep 2009 22:48:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 24 Sep 2009 22:48:04 +0000 (UTC) Cc: Emacs development discussions , Giuseppe Scrivano , Stefan Monnier To: Tom Tromey Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 25 00:47:48 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 1Mqx6J-0000jt-3T for ged-emacs-devel@m.gmane.org; Fri, 25 Sep 2009 00:47:47 +0200 Original-Received: from localhost ([127.0.0.1]:50793 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqx6I-00013O-HD for ged-emacs-devel@m.gmane.org; Thu, 24 Sep 2009 18:47:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mqx6D-00013J-Uj for emacs-devel@gnu.org; Thu, 24 Sep 2009 18:47:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mqx68-000137-GS for emacs-devel@gnu.org; Thu, 24 Sep 2009 18:47:40 -0400 Original-Received: from [199.232.76.173] (port=34972 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mqx68-000134-CD for emacs-devel@gnu.org; Thu, 24 Sep 2009 18:47:36 -0400 Original-Received: from splat.raeburn.org ([69.25.196.39]:58282 helo=raeburn.org) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mqx5u-00058e-G8; Thu, 24 Sep 2009 18:47:33 -0400 Original-Received: from [10.0.0.158] ([10.0.0.158]) by raeburn.org (8.14.3/8.14.1) with ESMTP id n8OMlHhg010015; Thu, 24 Sep 2009 18:47:17 -0400 (EDT) In-Reply-To: X-Mailer: Apple Mail (2.936) 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:115599 Archived-At: On Sep 24, 2009, at 16:04, Tom Tromey wrote: >>>>>> "Giuseppe" == Giuseppe Scrivano writes: > >>> 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. Yes! It was this very problem that initially got me thinking about threads (and from that, it was just a hop, skip and a jump to Guile) years ago. > 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. Yes, I think that needs to happen pretty much automatically. Perhaps it would be sufficient to make the Lisp functions that can cause process filters to be run also yield to other threads. > 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. Yes, and this is an area where Gnus could be changed to take advantage of it once the facility is a bit more stabilized. The output from one NNTP server can be processed into a list of newsgroups in one thread, while another thread converts IMAP output into a list of mailboxes, a third thread talks to yet another IMAP server, etc. It might be interesting to look at Apple's Grand Central model, and see if something like that is practical to use in elisp with dynamic bindings... Ken