From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alexander Miller Newsgroups: gmane.emacs.devel Subject: Re: Questions about throw-on-input Date: Mon, 11 May 2020 21:48:47 +0200 Message-ID: <3d053db9-c98a-7a5d-040c-cba1bd56f512@web.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="69070"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Cc: eliz@gnu.org, yyoncho@gmail.com, emacs-devel@gnu.org To: monnier@iro.umontreal.ca Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon May 11 22:25:25 2020 Return-path: Envelope-to: ged-emacs-devel@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 1jYEzM-000HqE-QN for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 22:25:24 +0200 Original-Received: from localhost ([::1]:35564 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jYEzL-0007Uz-Mf for ged-emacs-devel@m.gmane-mx.org; Mon, 11 May 2020 16:25:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56060) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jYEPl-0005s2-Qn for emacs-devel@gnu.org; Mon, 11 May 2020 15:48:38 -0400 Original-Received: from mout.web.de ([212.227.17.12]:43767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jYEPk-0002CH-FQ; Mon, 11 May 2020 15:48:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=dbaedf251592; t=1589226511; bh=HxsapiQc1LL057IomJ58k2YiWsGWLP+D/hGi+YSV+08=; h=X-UI-Sender-Class:To:Cc:Subject:In-Reply-To:From:Date; b=iF+gUQwkAs1VzBgf6y7q3n5fXTbTDIAP4/tkyq45rp+uKYklBMi8xastTJZwTL6pP ta91wGv0fz4/cHtMdNaQXAUPn5Uzy6elegKYA4ky3kAdS9uBQD/J+m0jqqEUraM0Ei cOK9xQSUffnT9XDxCdMNLDq3SLAA8GrKeTp9/eh8= X-UI-Sender-Class: c548c8c5-30a9-4db5-a2e7-cb6cb037b8f9 Original-Received: from [192.168.2.107] ([217.240.190.124]) by smtp.web.de (mrweb101 [213.165.67.124]) with ESMTPSA (Nemesis) id 0MKJ7S-1jZsZV0Ke6-001hpg; Mon, 11 May 2020 21:48:31 +0200 In-Reply-To: Content-Language: en-US X-Provags-ID: V03:K1:ayBtGo7Xev8oQbYtR3ksDbA8Mua9/nTUXZSVpkUGj6MD67xUKhP /pUfdNaAddMoFSpDHB5pGAQdS+aKN7ZY6BozIRB37XI5j9DehE/OmVvcnd/TND83WV+NGPC ysPT+TdYJ91OY2aDeKDcJH8tPboVtl6Cm/0mf2lWEpYKJAn7kFetgd7Z4AT60QYY7yH1+E/ kI+dYS3FpkBP+oKtRiLwg== X-UI-Out-Filterresults: notjunk:1;V03:K0:hk1Iye6lpH0=:LR3ipgMt8IL4kywZcyLq+D KhgIo4hjNszb10+MfzxyjAL9qxdYOIqkXu0liDK75C6B6S9L6LyjABkW5+wfU5l3kmIdk5po6 RScXoIoQKkv+QUJQdDvLwB96s77+aCKKna2jsabhqbkgYgxEXEVaZkAPmkPcVIp/XeiTFvxvJ s0yt1fttgnrJybyRPFKGII4y3jj3Nd2u8DGxP+W2h18acQoFKTLuqDiWqTAJrf5kyHH3CI+5G x4j33v3oufzqWRQLsh3ZYxX0zmfeKYde45NVr4KojIbiZcLjBqmmIBGcRn01IZK/tHDDTCQjs n+sDIO4ASoYSUxOU+h6g2QyhxGYUbXK49x95yXLAHK690pQWNVnJ9IOAbLDILH8kA3uJF2jrC emUDFSPU398/xFFq+gSqAq73LDgaRn2xcH4EB/Kz4zdllCpjlKB8irMxq+945o1hyuzkVGmBE HywYDswnIl27h9F61HFiQm/I+hBOlN2JW0pH8uURuJHxOpkW1G8nxQDpQzjBlXwBrKNop5IMw 62r66S5iBGGmGIZtfHAqVEE8qiRVBk0F5DqTuyMJvL/mdWEjK9NcK95JWHXwi62OZCxd24PJZ /PymhI89sVWHToGxHTsQePXyOpTvyWeSlRpLWZ595Uy2zhCYqKlugsSz/6yKHeZR70s8yBkdy +eiRSx0sx2ofS2WPxTuOjL24EJoStyZ6IYAFyOzhWt/a9Mw3Ic7X/4JcA1/V8J+6t447zH2kr j7N7LkwnuZtv5zDQRAbw88mKDdsYJ9s1mWCyvtPpDKtctWKWRWN+hSEZKgBiBj3uyfdY1Jel Received-SPF: pass client-ip=212.227.17.12; envelope-from=alexanderm@web.de; helo=mout.web.de X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/11 15:48:34 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-Mailman-Approved-At: Mon, 11 May 2020 16:22:20 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:249890 Archived-At: > Actually a better solution is often to run in a separate process > (e.g. via `async.el`). That also lets you use the various CPU cores > lying idle ;-) async.el starts slowly, has no good way to read the current state like text properties or buffer content, has no knowledge about loaded libraries and incurs double serialization overhead. If just a Hello World needs 70ms on my system imagine what it's like doing something with org. That is far from ideal. For context: I am mostly thinking about passive work in my treemacs package that happens without any user interaction, like re-rendering on changes in the file system or a file's tags, passively fontifying files based on their git status after some directory node has been opened or following the file the user is currently editing. All of that happens passively, so I consider any perceptible delay a no-go. Being able to just stop the git-fontify when the user types and later pick it up would be a major help. > I think calling `thread-yield` frequently enough should(!) do the trick. > No need to call `input-pending-p`. > > IOW if `thread-yield` doesn't do the trick, you should > likely `M-x report-emacs-bug`. Yielding doesn't work for me, my input is ignored most of the time. I will make my code emacs-q ready and open a bug report for it tomorrow. > Sounds very credible, but I'll let someone else take care of this, > because it's too far from my area of expertise. Same for me I'm afraid.