From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Helmut Eller Newsgroups: gmane.emacs.devel Subject: Re: Patch for fields of `struct buffer' Date: Sat, 12 Feb 2011 10:16:42 +0100 Message-ID: References: <4D46E75E.7080503@harpegolden.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1297502236 30139 80.91.229.12 (12 Feb 2011 09:17:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 12 Feb 2011 09:17:16 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 12 10:17:10 2011 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.69) (envelope-from ) id 1PoBbK-0007jN-31 for ged-emacs-devel@m.gmane.org; Sat, 12 Feb 2011 10:17:10 +0100 Original-Received: from localhost ([127.0.0.1]:53052 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoBbJ-0002lk-Ga for ged-emacs-devel@m.gmane.org; Sat, 12 Feb 2011 04:17:09 -0500 Original-Received: from [140.186.70.92] (port=42804 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoBbC-0002l3-J7 for emacs-devel@gnu.org; Sat, 12 Feb 2011 04:17:03 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PoBbB-0005oP-CS for emacs-devel@gnu.org; Sat, 12 Feb 2011 04:17:02 -0500 Original-Received: from lo.gmane.org ([80.91.229.12]:47073) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PoBbA-0005o7-Vm for emacs-devel@gnu.org; Sat, 12 Feb 2011 04:17:01 -0500 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PoBb9-0007fp-Cu for emacs-devel@gnu.org; Sat, 12 Feb 2011 10:16:59 +0100 Original-Received: from dial-181247.pool.broadband44.net ([212.46.181.247]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Feb 2011 10:16:59 +0100 Original-Received: from eller.helmut by dial-181247.pool.broadband44.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 12 Feb 2011 10:16:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: dial-181247.pool.broadband44.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:CNiqKvi+Ayl9CF+SL0owhiYwLAk= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:135936 Archived-At: * Tom Tromey [2011-02-11 21:59] writes: > Helmut> Where "task.el" is a file containing the program that does all the > Helmut> work. A worker starts with an (almost) empty environment and must > Helmut> initialize all needed state from zero. > > This seems very impractical to me. Why? > Helmut> In particular if some library is > Helmut> needed it must be loaded explicitly (that's not visible in the parent > Helmut> thread). A worker can only communicate with other threads via pipes (I > Helmut> think workers exchange Javascript objects in JSON format in HTML5; maybe > Helmut> we would use sexps for Emacs). > > A variant of this idea is either to add a `fork' primitive to Emacs (not > portable, more's the pity) or just spawn a headless Emacs with > bidirectional communication. With the fork approach you could even do > fancy things like let the child inherit and take over some network > connections. Inheritance is not strictly needed. File descriptors could be passed over Unix sockets. > This approach is somewhat heavy, as you say. Also, I think initializing > the new environment (in the spawn model) is non-trivial. All those > globals do matter... A copy-on-write scheme is difficult; starting from zero seems much simpler. Helmut