From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Miles Bader Newsgroups: gmane.emacs.devel Subject: Re: multi-threaded Emacs Date: Fri, 05 Dec 2008 17:20:08 +0900 Message-ID: References: <87abbiody1.fsf@master.homenet> <877i6l5d8s.fsf@master.homenet> <874p1npvtj.fsf@master.homenet> <87ej0qci8g.fsf@master.homenet> <87y6yxm7xr.fsf@master.homenet> <87oczroysm.fsf@master.homenet> Reply-To: Miles Bader NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228465240 16810 80.91.229.12 (5 Dec 2008 08:20:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 5 Dec 2008 08:20:40 +0000 (UTC) Cc: emacs-devel@gnu.org, rms@gnu.org, Stefan Monnier To: Giuseppe Scrivano Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 05 09:21:44 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 1L8VwV-0007Zg-Vo for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2008 09:21:44 +0100 Original-Received: from localhost ([127.0.0.1]:45164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8VvL-0000Qm-07 for ged-emacs-devel@m.gmane.org; Fri, 05 Dec 2008 03:20:31 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L8VvF-0000PF-CV for emacs-devel@gnu.org; Fri, 05 Dec 2008 03:20:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L8VvC-0000O5-PU for emacs-devel@gnu.org; Fri, 05 Dec 2008 03:20:23 -0500 Original-Received: from [199.232.76.173] (port=47301 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L8VvC-0000O2-Mk for emacs-devel@gnu.org; Fri, 05 Dec 2008 03:20:22 -0500 Original-Received: from tyo202.gate.nec.co.jp ([202.32.8.206]:34898) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L8Vv3-0003iO-JW; Fri, 05 Dec 2008 03:20:14 -0500 Original-Received: from relay21.aps.necel.com ([10.29.19.50]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id mB58Jxbu008859; Fri, 5 Dec 2008 17:20:10 +0900 (JST) Original-Received: from relay31.aps.necel.com ([10.29.19.20] [10.29.19.20]) by relay21.aps.necel.com with ESMTP; Fri, 5 Dec 2008 17:20:10 +0900 Original-Received: from dhapc248.dev.necel.com ([10.114.113.195] [10.114.113.195]) by relay31.aps.necel.com with ESMTP; Fri, 5 Dec 2008 17:20:10 +0900 Original-Received: by dhapc248.dev.necel.com (Postfix, from userid 31295) id A2D59455; Fri, 5 Dec 2008 17:20:09 +0900 (JST) System-Type: i686-pc-linux-gnu Blat: Foop In-Reply-To: <87oczroysm.fsf@master.homenet> (Giuseppe Scrivano's message of "Fri, 05 Dec 2008 08:40:09 +0100") Original-Lines: 28 X-detected-operating-system: by monty-python.gnu.org: Solaris 8 (1) 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:106598 Archived-At: Giuseppe Scrivano writes: >> I am surprised. Perhaps you're right, but why do you think so? >> Anywhere that calls QUIT is a place where it is safe for an error to happen, >> so why not a thread switch? > > The cooperative threads approach moves to Elisp packages more work as > they will have explicitly to yield control but it simplifies a lot the > C code. I already started to change my code to allow only the > execution of a thread at a time and add a `yield' primitive. No, it will will likely have almost no effect on lisp code, because 99.9% of the code won't be affected, and the lack of pre-emption allows that code to continue making traditional assumptions. The only changes required will be in places that are known to be long-running, where sticking in a few strategic calls to (yield) will probably relieve most of the problem. This is because emacs, being an interactive system, generally doesn't have a lot of long-running code. It's the relatively few exceptions to this rule (e.g. gnus reading in new messages) that are the main issues in practice. Fixing those places will probably yield a lot of benefit for (relatively) small amount of work. -Miles -- Brain, n. An apparatus with which we think we think.