From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: hw Newsgroups: gmane.emacs.devel Subject: Re: User interaction from multiple threads Date: Sat, 01 Sep 2018 19:32:07 +0200 Organization: my virtual residence Message-ID: <87in3rmpis.fsf@himinbjorg.adminart.net> References: <838t59j821.fsf@gnu.org> <837ekicw7i.fsf@gnu.org> <877ekiierh.fsf@himinbjorg.adminart.net> <834lflb2fj.fsf@gnu.org> <83h8jk9l41.fsf@gnu.org> <8336v2994c.fsf@gnu.org> <83bm9q6x7v.fsf@gnu.org> <874lfi863s.fsf@himinbjorg.adminart.net> <83va7x5guc.fsf@gnu.org> <871sakl97g.fsf@himinbjorg.adminart.net> <8336uz6e8e.fsf@gnu.org> <877ekbego9.fsf@himinbjorg.adminart.net> <83mut73vau.fsf@gnu.org> <87lg8qqh9n.fsf@himinbjorg.adminart.net> <83mut52o8g.fsf@gnu.org> <877ek9oscr.fsf@himinbjorg.adminart.net> <83o9dk0xu0.fsf@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1535824302 24143 195.159.176.226 (1 Sep 2018 17:51:42 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 1 Sep 2018 17:51:42 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: psainty@orcon.net.nz, gazally@runbox.com, rms@gnu.org, emacs-devel-bounces+psainty=orcon.net.nz@gnu.org, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 01 19:51:38 2018 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 1fwA3d-00069d-Mu for ged-emacs-devel@m.gmane.org; Sat, 01 Sep 2018 19:51:38 +0200 Original-Received: from localhost ([::1]:37999 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwA5k-00082g-3S for ged-emacs-devel@m.gmane.org; Sat, 01 Sep 2018 13:53:48 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56125) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fwA4L-0007GO-It for emacs-devel@gnu.org; Sat, 01 Sep 2018 13:52:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fw9uU-0001x3-1P for emacs-devel@gnu.org; Sat, 01 Sep 2018 13:42:10 -0400 Original-Received: from mo6-p02-ob.smtp.rzone.de ([2a01:238:20a:202:5302::2]:20901) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fw9uQ-0001u6-3o; Sat, 01 Sep 2018 13:42:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1535823724; s=strato-dkim-0002; d=adminart.net; h=Sender:References:Message-ID:Date:In-Reply-To:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=astwwm/kh2CpBqadZiWBUWGZ+lEVKRgs0W4f++XRTTE=; b=L8qB8IUyB69YKeZNNeo+oT2DbPNrMpteyNoEd4z5zu/Kn1aa683abaJYGOHLJkstWU XuCFrVZhD4zJbxbLeBYARLSLlb/CrNvqrUk+gfrTVL1GTc9EU08tu0jljmMo9TiRWJjj Vt9zv3UFrsw1O7YYqUld8muM+3CrL46Ns269f0aIH4RACsXyWLaiLO/nGQFsN1klKdk0 GEVmVBErRChyfscG7HKib1xFwIErR3SERgwWSju780DrqvR6eEmNWJrJhny79Fn4iVrq fGtnRa00Mw8ItiepQTzc+l03PzkxZeYk/vy8HZBMIjvhEdGpHplQMcU+UHyHHz9mbInB 8X9A== X-RZG-AUTH: ":O2kGeEG7b/pS1FS4THaxjVF9w0vVgfQ9xGcjwO5WMRo5c+h5ceMqQWZ3yrBp+AVdIIwXjneEe9k=" X-RZG-CLASS-ID: mo00 Original-Received: from himinbjorg.adminart.net by smtp.strato.de (RZmta 43.21 DYNA|AUTH) with ESMTPSA id j020b1u81HfoESM (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sat, 1 Sep 2018 19:41:50 +0200 (CEST) Original-Received: from lee by himinbjorg.adminart.net with local (Exim 4.90_1) (envelope-from ) id 1fw9u9-0001lQ-MD; Sat, 01 Sep 2018 19:41:49 +0200 In-Reply-To: <83o9dk0xu0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 30 Aug 2018 16:48:39 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a01:238:20a:202:5302::2 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:229164 Archived-At: Eli Zaretskii writes: >> From: hw >> Cc: psainty@orcon.net.nz, gazally@runbox.com, rms@gnu.org, emacs-devel-bounces+psainty=orcon.net.nz@gnu.org, emacs-devel@gnu.org >> Date: Wed, 29 Aug 2018 22:00:52 +0200 >> >> >> What information is available when a thread is created? >> > >> > See 'make-thread' for the gory details, but in a nutshell, just the >> > function which the thread will run and the optional name. >> >> Hm. I wish the description would also say how much overhead is involved >> in creating a thread to give us some idea about when to start a thread >> and when not. > > There's very little overhead, but if you are interested in the > details, I suggest to read thread.c. It's not a lot of code, and the > ideas are quite simple. I wish I had at least 50 lifetimes so I could do more of what I would like to do. Would you say that when a user is writing a function that does some string replacements within texts that are usually between 16 and 64kB in size should use multiple threads to replace different strings or not? I would expect it to be slower because of the overhead unless multiple threads could run at the same time. Since they can't, what would be an advantage of using multiple threads? >> Knowing only the name of a function and maybe a name for the thread is >> not much. What if the function calls other functions which prompt the >> user? Is it possible to show a backtrace so the user can get some idea >> about what might have caused the prompt to appear? > > Someone wrote a mode where you can list threads and display their > backtraces. > >> What if the name is designed maliciously? > > Why would you run malicious code? This is orthogonal to the issue > being discussed here. Because the names of the threads hide the fact that it is malicious so I don't know that it is. >> Also, the user goes like "I want to copy files" rather than "I want to >> call this function". I call functions when I can't remember what >> keystrokes to use but have an idea of how the function may be called. >> How is the function called that deletes files? Does that depend on >> whether the files are remote or local? What do I do when I can't figure >> out what Emacs wants to know when it shows a prompt? > > These questions again are orthogonal to the issue at hand, I think. Considering how the users can figure out what prompts mean and that they sometimes may not want to be disturbed by unrelated prompts means approaching the issue from a different angle while the technical problem of how to prompt them can reasonably not be solved without such considerations. >> If Emacs learns that she usually does not press '!', it could change its >> strategy :) But when it can prepare stuff using another thread, what >> does it matter when it's wrong? > > So we will need to have machine learning in Emacs for this to work > satisfactorily? That would depend on what one is satisfied with. Generally, well, why shouldn't an editor or other software learn about the preferences and the behaviour of its user and thus become able to yield a better usage experience and better support with the work the user is using the software to do? Thinking of it, I much prefer software that kinda does that already; only it doesn't do that by itself, so I have to do it --- by setting preferences, writing my own functions, defining my own key bindings, for example. I wouldn't need to do all that if the software could figure it out by itself.