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: threads and kill-buffer Date: Wed, 05 Sep 2012 12:28:09 -0600 Message-ID: <878vcoqq86.fsf@fleche.redhat.com> References: <87a9x55xvd.fsf@fleche.redhat.com> <83d321dvsr.fsf@gnu.org> <87mx148sao.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1346869700 14161 80.91.229.3 (5 Sep 2012 18:28:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2012 18:28:20 +0000 (UTC) Cc: emacs-devel@gnu.org To: sds@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 05 20:28:22 2012 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1T9KKo-0000py-O1 for ged-emacs-devel@m.gmane.org; Wed, 05 Sep 2012 20:28:18 +0200 Original-Received: from localhost ([::1]:54839 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9KKl-0001mM-Lt for ged-emacs-devel@m.gmane.org; Wed, 05 Sep 2012 14:28:15 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42772) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9KKj-0001m1-51 for emacs-devel@gnu.org; Wed, 05 Sep 2012 14:28:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T9KKi-0000td-3K for emacs-devel@gnu.org; Wed, 05 Sep 2012 14:28:13 -0400 Original-Received: from mx1.redhat.com ([209.132.183.28]:53781) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T9KKh-0000tW-RC; Wed, 05 Sep 2012 14:28:12 -0400 Original-Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q85ISB8l008208 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 5 Sep 2012 14:28:11 -0400 Original-Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q85IS9jA026474 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 5 Sep 2012 14:28:10 -0400 X-Attribution: Tom In-Reply-To: <87mx148sao.fsf@gnu.org> (Sam Steingold's message of "Wed, 05 Sep 2012 10:20:47 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:153067 Archived-At: >>>>> "Sam" == Sam Steingold writes: Sam> It is a certain way to lose data: imagine thread T1 moving data from Sam> buffer B1 to buffer B2 and thread T2 killing one of these buffers. We may eventually need a mechanism to let a thread lock a buffer. This kind of thing is harder than it seems. For example, in your scenario, you'd presumably want to lock both buffers -- but then you can easily end up in deadlocks. Anyway, as Eli said, this particular question is really just about a single case, of kill-buffer and current_buffer. Due to the current implementation, right now threads only present a few problems not already possible with process filters. For example, your scenario is possible already. I'm not trying to minimize the problems you point out; just to defer them. The current_buffer thing came up because it is a new problem arising from the concurrency changes, and one that I think we need to solve before the branch can be merged. I'll send a note soon about the other problems in this category. Tom