From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Richard M. Stallman" Newsgroups: gmane.emacs.devel Subject: Re: Threads in emacs implementation Date: Tue, 21 Jun 2005 11:13:38 -0400 Message-ID: References: <6dbd4d0005060619227dd41364@mail.gmail.com> <87vf4oaft8.fsf@zemdatav.stor.no-ip.org> <4nd5quav0o.fsf@lifelogs.com> <4nll5btxv7.fsf@lifelogs.com> <4nvf4eqnec.fsf@lifelogs.com> <4nzmtpqdlp.fsf@lifelogs.com> <4n7jgo3nxb.fsf@lifelogs.com> Reply-To: rms@gnu.org NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1119368890 7604 80.91.229.2 (21 Jun 2005 15:48:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 21 Jun 2005 15:48:10 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Jun 21 17:48:08 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Dkkxd-00013s-No for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2005 17:46:50 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Dkl45-0003bn-81 for ged-emacs-devel@m.gmane.org; Tue, 21 Jun 2005 11:53:29 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DkkvF-0008Ti-5S for emacs-devel@gnu.org; Tue, 21 Jun 2005 11:44:21 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DkkvE-0008T8-Gd for emacs-devel@gnu.org; Tue, 21 Jun 2005 11:44:20 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DkktW-00074z-3T for emacs-devel@gnu.org; Tue, 21 Jun 2005 11:42:34 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DkkVB-0000TN-PS for emacs-devel@gnu.org; Tue, 21 Jun 2005 11:17:25 -0400 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.34) id 1DkkRW-0008Pg-JO; Tue, 21 Jun 2005 11:13:40 -0400 Original-To: Ted Zlatanov In-reply-to: <4n7jgo3nxb.fsf@lifelogs.com> (message from Ted Zlatanov on Mon, 20 Jun 2005 14:04:16 -0400) 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:39231 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:39231 If the secondary thread modifies a global, make the copy then (Copy On Write). This would be difficult to implement, considering that a symbol's value is normally kept in its value cell. The interpreter would just have to keep a hashtable of hashtables; primary key is the secondary thread ID and the secondary key is the global symbol. When a thread modifies a global, look in the HoH; if the symbol is not in there you create an entry. That would make the usual case much slower. I prefer the idea of swapping bindings on thread switches.