From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: multi-threaded Emacs Date: Mon, 01 Dec 2008 15:34:21 -0500 Message-ID: References: <87abbiody1.fsf@master.homenet> <877i6l5d8s.fsf@master.homenet> <874p1npvtj.fsf@master.homenet> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228163840 7254 80.91.229.12 (1 Dec 2008 20:37:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Dec 2008 20:37:20 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org To: Giuseppe Scrivano Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 01 21:38:23 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 1L7FX0-0005BI-Ut for ged-emacs-devel@m.gmane.org; Mon, 01 Dec 2008 21:38:11 +0100 Original-Received: from localhost ([127.0.0.1]:52019 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7FVq-0008Dd-QZ for ged-emacs-devel@m.gmane.org; Mon, 01 Dec 2008 15:36:58 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7FTS-0007Cb-V2 for emacs-devel@gnu.org; Mon, 01 Dec 2008 15:34:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7FTS-0007C8-AZ for emacs-devel@gnu.org; Mon, 01 Dec 2008 15:34:30 -0500 Original-Received: from [199.232.76.173] (port=35109 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7FTS-0007C1-5Q for emacs-devel@gnu.org; Mon, 01 Dec 2008 15:34:30 -0500 Original-Received: from pruche.dit.umontreal.ca ([132.204.246.22]:43553) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L7FTP-0004Hx-FK; Mon, 01 Dec 2008 15:34:27 -0500 Original-Received: from alfajor.home (vpn-132-204-232-120.acd.umontreal.ca [132.204.232.120]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id mB1KYwNT015619; Mon, 1 Dec 2008 15:34:58 -0500 Original-Received: by alfajor.home (Postfix, from userid 20848) id 091441C1EF; Mon, 1 Dec 2008 15:34:21 -0500 (EST) In-Reply-To: <874p1npvtj.fsf@master.homenet> (Giuseppe Scrivano's message of "Mon, 01 Dec 2008 19:57:44 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3159=0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) 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:106407 Archived-At: > solution, what I would like to optimize using threads is I/O bound and a > concurrent model can do it only in part. If an Elisp primitive is > waiting for some data from a file or a socket, Emacs will hang until it > is ready. This problem can't be solved by concurrent threads that will Actually, no: while Emacs is waiting for socket data, it can already run other async code, such as process filters. So we can solve most I/O bound problems just by using a very coarse notion of concurrency. We already partly do it, except we're currently limited to a single stack, which makes coding painful and prevents some useful cases. Providing a cooperative threading model will remove this problem. But, no it's not a "final solution": I hope there never will be a final solution, because Emacs will always need to evolve. Stefan