From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.devel Subject: Tramp and concurrency (was: Please test the merge of the concurrency branch) Date: Sun, 11 Dec 2016 16:14:48 +0100 Message-ID: <87k2b6xztj.fsf_-_@gmx.de> References: <83oa0lgnzx.fsf@gnu.org> <195DE508-E3ED-4BF9-AE96-EBE2157EFAAC@raeburn.org> <87eg1eltje.fsf@gmx.de> <6FD3E405-B333-4A4D-8729-63248C7409CC@raeburn.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1481469353 7800 195.159.176.226 (11 Dec 2016 15:15:53 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 11 Dec 2016 15:15:53 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) Cc: Eli Zaretskii , Tom Tromey , emacs-devel@gnu.org To: Ken Raeburn Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Dec 11 16:15:49 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 1cG5qu-0001Yw-77 for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 16:15:48 +0100 Original-Received: from localhost ([::1]:56001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cG5qy-0007Oc-CR for ged-emacs-devel@m.gmane.org; Sun, 11 Dec 2016 10:15:52 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cG5qQ-0007OM-2Q for emacs-devel@gnu.org; Sun, 11 Dec 2016 10:15:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cG5qP-0007lm-75 for emacs-devel@gnu.org; Sun, 11 Dec 2016 10:15:18 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:51364) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cG5qL-0007jm-BL; Sun, 11 Dec 2016 10:15:13 -0500 Original-Received: from detlef.gmx.de ([79.195.5.235]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M1FAK-1cVYJv3qrw-00tEas; Sun, 11 Dec 2016 16:14:52 +0100 In-Reply-To: <6FD3E405-B333-4A4D-8729-63248C7409CC@raeburn.org> (Ken Raeburn's message of "Sun, 11 Dec 2016 08:54:52 -0500") X-Provags-ID: V03:K0:n+T2mvtnB7EsF+XFW/ZXWzVDi0O5Ap9Ki6eNpyGP3ou5SyJveJZ +Xf8eGQtIMpSXifRm3YzJRBQNF/jn/PFYiJcj2c1oHclHPNRdEHZ5fKGr1mhMB5+AHhX2e+ HeNuZDEvhFwlx9CjUHf3aPeWKj+ECfZjQhFe5Ewy71R7B/vAlPiJVj8AkHOosXT3CHggOSr R7mlZ5udrzX4alloCKnsQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:I7py0KJE+QQ=:dj/dCWEr5m9mQG+LnaPRP7 fy3h0YueQCiKh6+yPAdwtLEQYEsyvJ7Io5wCLesJlVTTD992DXKMDYTpJxHmmt0PEqgOD3mnZ n9hRa/Ch8K5WeiWIYNknGDTpQQhAAovC1Ot1QylTHy1eGVxVrk/2p4194uXmTo6oSI3tUF4Vu ROtUGCoX5Li0Wrp+yzRFjx0oeRTQizyVbDiumUqi3jO1OhnHcfZPPWlOnp5imwl0P/fg/M8L5 PSQoN6nSNopZ4Dly/YF82LAXrAovUIylMf4l4pBw+BmM5dE8DbpfofL78EwXJX+m9HGbD0jjt 3DflYcli+XXn6K/C961FhiUr46+FwhhyY6bQO233dEzsoo4gHhCpWMsndPSCqR8k53eFJOhjH xAqvzxZWZE5I574aZ+EkJe9HvbLU23sn0o6vWAGNTHXppns1p0qd2FJvUkmM/dRlB58+R2gHX 93UBzb11rZFtnjF+f5UL61yuIEoixSeYr8zo/EgY4/uuOVEjo0OX+Hjf8nOKkTvEUBeofkCGP WFK4RSx95m0gZn+YIqyO1DVx/7fIW0hz7kRxOrp7FWPL8VhtGG+jCXwbn598mc+nNB+ap8pAI xD0zu6+RaIQ12+CFA5OOEw2KxsX7ViqH1cx2VKJOUOvnNYB1lT53L1Bgz6PKY3brqCjoQs+MS qHW0SuSKuOdoHPHGLBvvr3EziXwo67BIne1J5Pu5aUOpUZxu6VAt7wCOA959r+wxlK4RPMs8p 9heI/hrMdILWRyp2pBSlqhzzMNlGNJNXAFyMxCr5flB9o8gykHtK1xm+hUauWx/7gh13wQy0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 212.227.17.22 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:210273 Archived-At: Ken Raeburn writes: >> If people have proposals what to change in Tramp wrt concurrency, please >> say so. Of course I know that, for example, file copying shall not block >> further Emacs use, but I'm still uncertain how to integrate this. As of >> today, all callers of `copy-file' and friends do expect, that the >> copying has finished once the function returns. > > Given that it=E2=80=99s an optional feature at this point (and not suppor= ted > by every OS), I=E2=80=99d be careful in how you try to make use of it. > > In fact, Tramp is one of the areas where you might want to consider > whether some, ah, defensive changes might be wise first. For example, > if I have a couple of threads invoking find-file in a package of mine, > and both invocations have Tramp filenames, and the Tramp code has > blocking calls (e.g., waiting for subprocess output) that result in > thread switching, both threads could be trying to mess around with the > same Tramp data structures and subprocess communications, with messy > results. Unless we want to tell people =E2=80=9Cdon=E2=80=99t do file op= erations in > more than one thread=E2=80=9D, or =E2=80=9Cdon=E2=80=99t do Tramp operati= ons in more than one > thread=E2=80=9D (in which case people doing file operations need to check > whether they=E2=80=99re local files?), maybe Tramp should do some locking > internally. Well, Tramp distinguishes between "inline methods" (all communication goes over the same channel, like for "ssh"), and "external methods", which invoke an own subprocess for data transfer, like for "scp". A first candidate for concurrency would be external methods; switching between processes happens there already. And I agree that Tramp shall offer this as optional feature. This is also a must, because Tramp supports also older Emacsen w/o concurrency. > And what happens if I invoke =E2=80=9Ctramp-cleanup-all-connections=E2=80= =9D while a > file-reading operation is in progress? Don't know yet. Maybe all such functions in other threads must raise an "interrupted" error, or so. > Ken Best regards, Michael.