From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: What's the problem? Date: 11 Dec 2003 09:12:17 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <4nllpt3hr3.fsf@lockgroove.bwh.harvard.edu> <5bad69zd43.fsf@lister.roxen.com> <4noeuon378.fsf@lockgroove.bwh.harvard.edu> <4ny8tsgxy6.fsf@lockgroove.bwh.harvard.edu> <4nhe0ggv0u.fsf@lockgroove.bwh.harvard.edu> <4nk75bwjaf.fsf@lockgroove.bwh.harvard.edu> <4nsmjv8d32.fsf@collins.bwh.harvard.edu> <87iskpbloe.fsf@mail.jurta.org> , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Thu Dec 11 15:38:02 2003 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AURx4-0003Rt-00 for ; Thu, 11 Dec 2003 15:38:02 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AURx4-0001pb-00 for ; Thu, 11 Dec 2003 15:38:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AUStV-0005IL-CK for emacs-devel@quimby.gnus.org; Thu, 11 Dec 2003 10:38:25 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AUSpe-00047G-Sk for emacs-devel@gnu.org; Thu, 11 Dec 2003 10:34:26 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AUSp7-0003wG-99 for emacs-devel@gnu.org; Thu, 11 Dec 2003 10:34:24 -0500 Original-Received: from [132.204.24.67] (helo=mercure.iro.umontreal.ca) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AUSVk-0000DZ-5e; Thu, 11 Dec 2003 10:13:52 -0500 Original-Received: from vor.iro.umontreal.ca (vor.iro.umontreal.ca [132.204.24.42]) by mercure.iro.umontreal.ca (Postfix) with ESMTP id E5FC52102E; Thu, 11 Dec 2003 09:12:19 -0500 (EST) Original-Received: by vor.iro.umontreal.ca (Postfix, from userid 20848) id 33F8E3CFD9; Thu, 11 Dec 2003 09:12:18 -0500 (EST) Original-To: Miles Bader In-Reply-To: Original-Lines: 22 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 X-DIRO-MailScanner-Information: Please contact the ISP for more information X-DIRO-MailScanner: Found to be clean X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:18635 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:18635 > or every 100 iterations, or something like that. In a cooperative > multi-tasking system, you'd just stick in a (yield) or something, but in > emacs this would be very hard to support. I don't see why this should be so hard. What we're talking about is basically multiple-stacks, context-switches done only from Feval (i.e. at elisp granularity so there's no concurrency in the C code), some form of elisp forking and locking primitives (I suggested to lock a buffer at a time, but we also need to prevent context-switches during special cases such as jit-lock), and a lot of experimenting. One case I recently bumped into where using the current event-driven functionality is not possible (even for I/O) is in Tramp where the wait can easily be on the order of a minute for the initial connection. In a case like this one, I think the thread creation primitive needed would be something akin to the shell's "C-z + bg". Maybe something like (if (fork) (throw 'toplevel) ...) if a `fork' like primitive makes sense, or just a new primitive `make-new-toplevel-thread'. Stefan