From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: joakim@verona.se Newsgroups: gmane.emacs.devel Subject: Re: multi-threaded Emacs Date: Mon, 01 Dec 2008 23:41:07 +0100 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 1228171479 3086 80.91.229.12 (1 Dec 2008 22:44:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 1 Dec 2008 22:44:39 +0000 (UTC) Cc: emacs-devel@gnu.org, Giuseppe Scrivano , rms@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 01 23:45:42 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 1L7HWP-0002Zi-F5 for ged-emacs-devel@m.gmane.org; Mon, 01 Dec 2008 23:45:42 +0100 Original-Received: from localhost ([127.0.0.1]:39334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7HVF-00076E-9o for ged-emacs-devel@m.gmane.org; Mon, 01 Dec 2008 17:44:29 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L7HVB-00075w-9W for emacs-devel@gnu.org; Mon, 01 Dec 2008 17:44:25 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L7HV7-00074S-SS for emacs-devel@gnu.org; Mon, 01 Dec 2008 17:44:25 -0500 Original-Received: from [199.232.76.173] (port=34647 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L7HV7-00074P-Mu for emacs-devel@gnu.org; Mon, 01 Dec 2008 17:44:21 -0500 Original-Received: from iwfs.imcode.com ([82.115.149.64]:46697 helo=gate.verona.se) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L7HV4-0007iN-Tf; Mon, 01 Dec 2008 17:44:19 -0500 Original-Received: from localhost.localdomain (IDENT:1005@localhost [127.0.0.1]) by gate.verona.se (8.13.4/8.11.4) with ESMTP id mB1Mi4L7024008; Mon, 1 Dec 2008 23:44:04 +0100 In-Reply-To: (Stefan Monnier's message of "Mon, 01 Dec 2008 15:34:21 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.4-2.6 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:106410 Archived-At: Stefan Monnier writes: >> 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. Beautifully put. > > Stefan > -- Joakim Verona