From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Magnus Henoch Newsgroups: gmane.emacs.devel Subject: Re: Threads in emacs implementation Date: Wed, 08 Jun 2005 20:01:23 +0200 Message-ID: <87vf4oaft8.fsf@zemdatav.stor.no-ip.org> References: <6dbd4d0005060619227dd41364@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1118254182 28805 80.91.229.2 (8 Jun 2005 18:09:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 8 Jun 2005 18:09:42 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Jun 08 20:09:33 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dg4z2-0003AC-Qf for ged-emacs-devel@m.gmane.org; Wed, 08 Jun 2005 20:08:57 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg52P-0008Ew-WD for ged-emacs-devel@m.gmane.org; Wed, 08 Jun 2005 14:12:26 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Dg51c-0007yd-Im for emacs-devel@gnu.org; Wed, 08 Jun 2005 14:11:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Dg51U-0007tq-D2 for emacs-devel@gnu.org; Wed, 08 Jun 2005 14:11:28 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dg51U-0007sc-4D for emacs-devel@gnu.org; Wed, 08 Jun 2005 14:11:28 -0400 Original-Received: from [80.91.229.2] (helo=ciao.gmane.org) by monty-python.gnu.org with esmtp (TLS-1.0:RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Dg4zp-0004sU-Mc for emacs-devel@gnu.org; Wed, 08 Jun 2005 14:09:45 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Dg4ol-0001WL-Rl for emacs-devel@gnu.org; Wed, 08 Jun 2005 19:58:19 +0200 Original-Received: from h170n1fls23o1074.bredband.comhem.se ([213.67.239.170]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Jun 2005 19:58:19 +0200 Original-Received: from mange by h170n1fls23o1074.bredband.comhem.se with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 08 Jun 2005 19:58:19 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-To: emacs-devel@gnu.org Original-Lines: 12 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: h170n1fls23o1074.bredband.comhem.se User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (berkeley-unix) Cancel-Lock: sha1:YMBzFgLIQ6xlqz3enLGeMO6MJlo= 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:38355 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:38355 I've been thinking about using GNU pth to implement threads in Emacs. GNU pth only does cooperative threading, and has special non-blocking versions of some syscalls (blocking the current thread instead of the whole process). Ideally this would mean that existing (i.e. non-yielding) Lisp code would not be affected, and network code could be run in a background thread. 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... Magnus