From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nic Ferrier Newsgroups: gmane.emacs.devel Subject: Re: Threads in emacs implementation Date: Wed, 08 Jun 2005 21:47:22 +0100 Message-ID: <87r7fca84l.fsf@kanga.tapsellferrier.co.uk> References: <6dbd4d0005060619227dd41364@mail.gmail.com> <87vf4oaft8.fsf@zemdatav.stor.no-ip.org> <87vf4oaao5.fsf@kanga.tapsellferrier.co.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118263932 31485 80.91.229.2 (8 Jun 2005 20:52:12 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Jun 2005 20:52:12 +0000 (UTC) Cc: Magnus Henoch , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 08 22:52:09 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dg7U8-0005J3-R3 for ged-emacs-devel@m.gmane.org; Wed, 08 Jun 2005 22:49:13 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg7aY-0003yk-Ui for ged-emacs-devel@m.gmane.org; Wed, 08 Jun 2005 16:55:50 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dg7a2-0003qq-J8 for emacs-devel@gnu.org; Wed, 08 Jun 2005 16:55:18 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dg7Zp-0003gg-2s for emacs-devel@gnu.org; Wed, 08 Jun 2005 16:55:06 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg7Zo-0003gF-WA for emacs-devel@gnu.org; Wed, 08 Jun 2005 16:55:05 -0400 Original-Received: from [80.168.156.78] (helo=owls-tree.tapsellferrier.co.uk) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Dg7Wy-00018c-5V for emacs-devel@gnu.org; Wed, 08 Jun 2005 16:52:08 -0400 Original-Received: from [80.168.156.68] (helo=kanga) by owls-tree.tapsellferrier.co.uk with esmtp (Exim 4.50 #1 (Debian)) id 1Dg7Rp-0006sq-IP; Wed, 08 Jun 2005 21:46:49 +0100 Original-Received: from nferrier by kanga with local (Exim 4.44) id 1Dg7SN-0004JW-7Q; Wed, 08 Jun 2005 21:47:23 +0100 Original-To: jhd In-Reply-To: (jhd's message of "Wed, 8 Jun 2005 22:23:11 +0200") 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:38369 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38369 jhd writes: >>> The greatest obstacle to this seems to be shallow binding - you'd >>> have >>> to unwind one thread's stack and rewind another's when switching >>> threads. Maybe there's an easier way that I don't see... >>> >> >> I don't see why this subject keeps coming up. >> >> We don't need threads in elisp. Just more asynchronous network >> implementations. >> >> Anyway, async code is so much more fun to write than threaded >> code. Threads are for beginners. > > Async network code won't take advantage of multiple CPU:s. Threads > do. Pth, for example, won't take advantage of multiple CPUs. I think elisp is always going to need a huge amount of blocking to use OS threads because of the nature of dynamic scope. Emacs does already get an advantage from multiple CPUs because it uses co-processes a lot. Co-processes are much less burdensome on multi-core architectures. The best way to handle co-processes is with async IO. Nic