From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Concurrency, again Date: Mon, 17 Oct 2016 14:41:19 -0400 Message-ID: References: <87wq97i78i.fsf@earlgrey.lan> <86k2dk77w6.fsf@molnjunk.nocrew.org> <9D64B8EA-DB52-413D-AE6A-264416C391F3@iotcl.com> <83int1g0s5.fsf@gnu.org> <83twckekqq.fsf@gnu.org> <83mvi9a3mh.fsf@gnu.org> <20161012165911.58437154@jabberwock.cb.piermont.com> <20161012173314.799d1dc5@jabberwock.cb.piermont.com> <8360owaj2s.fsf@gnu.org> <20161013092701.77461800@jabberwock.cb.piermont.com> <87insvt0i9.fsf@lifelogs.com> <5B6D2CCB-4D96-40E4-BE43-EE49E3D2F1D7@raeburn.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1476732578 7171 195.159.176.226 (17 Oct 2016 19:29:38 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 19:29:38 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Oct 17 21:29:34 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bwDbA-0000Ne-E8 for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 21:29:24 +0200 Original-Received: from localhost ([::1]:35350 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwDbC-0000g5-3n for ged-emacs-devel@m.gmane.org; Mon, 17 Oct 2016 15:29:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39458) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bwCrm-0002iX-3I for emacs-devel@gnu.org; Mon, 17 Oct 2016 14:42:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bwCri-0001zi-Q5 for emacs-devel@gnu.org; Mon, 17 Oct 2016 14:42:30 -0400 Original-Received: from [195.159.176.226] (port=34517 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1bwCri-0001zK-JD for emacs-devel@gnu.org; Mon, 17 Oct 2016 14:42:26 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1bwCr8-0008Eo-N1 for emacs-devel@gnu.org; Mon, 17 Oct 2016 20:41:50 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 16 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:thsgAtBQAY+1d9WtylSjNFCo7nI= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:208380 Archived-At: > - regexp scanning in a huge file that took so long my IM sessions would time > out because the Emacs-based client code couldn’t respond to the server > (which scanning also turned out not to be interruptible with ^G) FWIW, this is an algorithmic problem. The better to way to fix this is to avoid backtracking in the regexp engine. Also to avoid this problem, we'd need to spawn a new thread and since regexp-matching is normally not expected to take a long time, that means we'd need to spawn a new thread either "all the time" (just in case it proves necessary), or "lazily" (i.e. if the current command takes too long, then user can use a special handshake that spawns a new thread and lets the current command finish asynchronously in that thread). Stefan