From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.bugs Subject: bug#61350: Eglot over Tramp freezes with large project Date: Sat, 18 Feb 2023 13:07:32 +0100 Message-ID: <875ybz89dn.fsf@gmx.de> References: <1163788660.69273.1675787581764@office.mailbox.org> <87r0uo7h2w.fsf@gmx.de> <1557187872.167775.1676630029885@office.mailbox.org> <687235760.209554.1676718644945@office.mailbox.org> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13556"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "joaotavora@gmail.com" , 61350@debbugs.gnu.org To: Thomas Koch Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Feb 18 13:08:24 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pTM0t-0003NT-RN for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 18 Feb 2023 13:08:23 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pTM0a-0001cW-C4; Sat, 18 Feb 2023 07:08:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pTM0Y-0001cA-Rw for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 07:08:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pTM0Y-00011B-JB for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 07:08:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pTM0Y-0001wS-6h for bug-gnu-emacs@gnu.org; Sat, 18 Feb 2023 07:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Michael Albinus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 18 Feb 2023 12:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61350 X-GNU-PR-Package: emacs Original-Received: via spool by 61350-submit@debbugs.gnu.org id=B61350.16767220717448 (code B ref 61350); Sat, 18 Feb 2023 12:08:02 +0000 Original-Received: (at 61350) by debbugs.gnu.org; 18 Feb 2023 12:07:51 +0000 Original-Received: from localhost ([127.0.0.1]:42716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTM0N-0001w4-9q for submit@debbugs.gnu.org; Sat, 18 Feb 2023 07:07:51 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:37129) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pTM0J-0001vl-LH for 61350@debbugs.gnu.org; Sat, 18 Feb 2023 07:07:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1676722058; i=michael.albinus@gmx.de; bh=XGg/uhJaAsE7SrFTcPHw8pVj6hQFR8u6NxMtueh+nX4=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=W98yTGJk2Qa1HnFIPJb6ew1oX8QtZ5i14Jr9+/3CtSDD0UmJYwenHXwSkPbYQhoEs Vu+JPii1KodoiqbsA7Aqg0sB+EY7ne4HssSvhTi6yhNmTHNSR7mFZcMgo47s9qSYHK LDsG2gDrSLrbD5WE+/gn+zkz0EAh75KZcNMCjCXod5cWl3L4fcqU8uTz917DQhJAMf 5xYpAlRRfTq9kXz1kECTNS418r/Phu9h3s2BwpDEIsvKiybycn1hJwpw7u2nXKXd1Q ZUUKDLT/fiumE/BTsjy49JlyrdVG8qIOjKSO+U6q0B3+BJaEXou45+CjCRO2LqqgoM PAyj8WTA1fJew== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from gandalf.gmx.de ([185.89.39.22]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mxm3Q-1obuEx3gx4-00zIfR; Sat, 18 Feb 2023 13:07:38 +0100 In-Reply-To: <687235760.209554.1676718644945@office.mailbox.org> (Thomas Koch's message of "Sat, 18 Feb 2023 13:10:44 +0200 (EET)") X-Provags-ID: V03:K1:qIvI6jmDHYt0jRHMRZ9oWfXuR+JJimMm2HvjZdf78l5UIolqHEK kfYNA9hiCxzexz+jTw/q5OMWc3oumMedr8hVaNQvsY499kl30VRCBzYDsEZj2LgudQZMfea Cbx5ARDXEwXH1kHsdT0M0JcmBslco4CDwjzAffXcjRUhyj0tVQdCiQ9bJIUjT3BgwkBXt8l K3w958Rj3fThn65bFEVmw== UI-OutboundReport: notjunk:1;M01:P0:UrlZVS+NlaQ=;J9XnQ7sW3Wr2xaxNLvmhcSvlYOo yflB6chUPipfu2/m1qYkn3mth8o38bnuogUFUKrFGjQLQ+xD6B+HqL0pOhOWiJ1J/PPXmF/Bo 9eT4HtMjS0v6veTjHI23WCNmPGfRp4dtyg9npEHxHOzlqeC3+TeWhzDy2oGgsgtqPbnN7KAqJ tyD/sS19GWwste4opvNqLh7QzN7T6lhCYZ+HW2zLRyvP11ULIiccx+dXACMHpmT5HsHEndhim KL6Nij0FjjgdDoScy0qBfldXk4170ucvk/oACOE10ob6ldJt0rOhlfdBUVn12Nl0HuE9nQTyc EOE6FpFt+unu/QWndVi2PigLurve5HCUfztIsIzgvw6mou1OtgCZZFzYlr8XmHfMlmOHZ8RF/ OZFxHe+0BvfHXUFSKzVZxAWM6g4EcUu6cWyLTPI3OwjFTVlKe27qJbq+s/GOWmaBRouZMHiQe SZbGBspSnCuV7xh0644w2hVZe/oxk8rcHMEJJ3MTP17uH7AFdwsUMnE4FH6Zvznr1vp5c6SgS HqoKTw6Cw0fKX5rC88k6nwbF/ltBmy+7vYXA3DDkq2l6nj7GGjgP/s+lGwWhhhEca5vCIo/qW OMfrdLFTfksuDV633cYE3OOG3w8L5tSbpuTtzbraCMf1AN11E7aLa6BoWiH2CZJvo42uwlehh R9zNlJojwie23f3d4c3nfiSHIggTaG9wU2Pre93sMlVjrSb+Q1HISJqoyaceoNwrWMmLXnnTq Hb8sXvaiBasaZjQzEOBjcS2iGgt5F7FicxgwNr9SDPdt/VlEa5Eop096U2sexCXlQR3ic+72 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:255962 Archived-At: Thomas Koch writes: Hi Thomas, > Please bare with me Michael, if I ask a stupid question although > you're a long time Emacs contributor. I saw now that concurrency in > Emacs is an age old problem: > https://www.emacswiki.org/emacs/ConcurrentEmacs Don't worry. You don't ask stupid questions, often it is useful to think differently. > There are emacs-async and emacs-deferred. Couldn't one of them be used > to write a non-blocking wrapper for file-io? NodeJS made this > programming model popular when it appeared in 2009. I can't believe > that nobody discussed this before for Emacs? emacs-async uses a second Emacs instance, AFAIU. I doubt that this approach is helpful for Tramp, which needs to read files into buffers and alike. emacs-deferred I don't know. > Meanwhile I could hack eglot to not block so far by replacing > find-buffer-visiting with get-file-buffer in > eglot-handle-notification. Of course there will probably be other > places that cause problems and I could also only use this hack because > my project files are not opened via symlinks. Yes, that's similar to what I've done while trying to mitigate the problem. But then, later, there was still the famous "Forbidden reentrant call of Tramp", which we must fix anyway. In fact, the threaded Tramp some years ago wasn't that bad. It worked in many cases. The major problem with threads in Emacs is user interaction. When there is a dialogue with a user, for example asking for a password in the minibuffer, it happened that the user input didn't return to the correct thread. Something like a UI-thread is needed in Emacs, I believe. That is, all threads in Emacs delegate user interaction to that UI-thread, and then wait for the result via a mutex. Something like this. For the new attempt to bring threads to Tramp, I plan another approach. Not a whole operation (like find-file) shall be located into an own thread. Instead, just the process communication, process-send-string and accept-process-output, shall be delegated to another thread. This are the places we have problems. Let's see how far I could go. But pls don't hold your breath, it will take time until I could show results. Best regards, Michael.