From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Tromey Newsgroups: gmane.emacs.devel Subject: Re: Concurrency Date: Mon, 29 Mar 2010 10:49:07 -0600 Message-ID: References: <27349166.post@talk.nabble.com> <4B754E74.8060705@swipnet.se> <27563610.post@talk.nabble.com> <4B7564C7.1010309@swipnet.se> <27564728.post@talk.nabble.com> <4B756FB7.3050202@swipnet.se> <87k4ui4gik.fsf@lola.goethe.zz> <27566385.post@talk.nabble.com> <87wryi2sjd.fsf@lola.goethe.zz> <27585994.post@talk.nabble.com> <87k4ucdmwh.fsf@stupidchicken.com> <87d3zweq4e.fsf@master.homenet> <87y6hg1h4a.fsf@thor.thematica.it> <87tys3j9fa.fsf@lifelogs.com> <87eij6tqmu.fsf@lifelogs.com> <0313BE4F-1CA1-4CFD-9CF9-ADA3AFF9ECF3@raeburn.org> Reply-To: Tom Tromey NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1269881558 5633 80.91.229.12 (29 Mar 2010 16:52:38 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 29 Mar 2010 16:52:38 +0000 (UTC) Cc: "emacs-devel@gnu.org discussions" To: Ken Raeburn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Mar 29 18:52:34 2010 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 1NwIBw-0000TU-Bi for ged-emacs-devel@m.gmane.org; Mon, 29 Mar 2010 18:52:34 +0200 Original-Received: from localhost ([127.0.0.1]:39561 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwIBm-00022g-AE for ged-emacs-devel@m.gmane.org; Mon, 29 Mar 2010 12:51:46 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NwI9b-0001br-E1 for emacs-devel@gnu.org; Mon, 29 Mar 2010 12:49:31 -0400 Original-Received: from [140.186.70.92] (port=59348 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NwI9Z-0001ae-9z for emacs-devel@gnu.org; Mon, 29 Mar 2010 12:49:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NwI9S-0001xI-Ul for emacs-devel@gnu.org; Mon, 29 Mar 2010 12:49:29 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:1025) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NwI9S-0001wu-Lx for emacs-devel@gnu.org; Mon, 29 Mar 2010 12:49:22 -0400 Original-Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2TGnIeS004352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 29 Mar 2010 12:49:19 -0400 Original-Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2TGn840017198; Mon, 29 Mar 2010 12:49:11 -0400 Original-Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o2TGn8Gd000517; Mon, 29 Mar 2010 12:49:08 -0400 Original-Received: by opsy.redhat.com (Postfix, from userid 500) id BA3A0378185; Mon, 29 Mar 2010 10:49:07 -0600 (MDT) X-Attribution: Tom In-Reply-To: <0313BE4F-1CA1-4CFD-9CF9-ADA3AFF9ECF3@raeburn.org> (Ken Raeburn's message of "Mon, 29 Mar 2010 12:25:32 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. 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:122854 Archived-At: >>>>> "Ken" == Ken Raeburn writes: Tom> * The current code makes no attempt to portable, it relies on POSIX Tom> threads and the GNU __thread extension. This is not too hard to Tom> fix. I think it is reasonably important to keep __thread on Tom> systems that support it, for performance. Ken> Dealing with __thread shouldn't be hard if it's not used Ken> pervasively, so pthread_{get,set}specific calls can be used in its Ken> place. There is exactly one __thread variable. Tom> * Suppose you have existing elisp that creates a process with a filter, Tom> and the filter changes a let-bound variable, and the "outer" elisp Tom> blocks in sit-for waiting for the filter to do its thing. Nothing in Tom> the current code guarantees that the process filter will be run in the Tom> "correct" thread. Ken> That may be a reason to force the filter to run in the same thread Ken> that created it. Yeah. I was thinking perhaps process filters could have a thread attribute, which would default to their creating thread. Setting this to nil could mean that the process filter could run in any thread. Ken> Perhaps process filters could be run at thread-switch opportunities Ken> like 'yield', too? (And vice versa -- perhaps calls that permit Ken> the running of process filters should also permit thread Ken> switching?) I think (but am not 100% sure) that this already happens -- IIUC, things like sleep-for and sit-for end up in wait_reading_process_output, which has a possible yield in it. Tom