From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: User interaction from multiple threads Date: Thu, 30 Aug 2018 16:48:39 +0300 Message-ID: <83o9dk0xu0.fsf@gnu.org> References: <838t59j821.fsf@gnu.org> <83pnybdaer.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> NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1535637408 6800 195.159.176.226 (30 Aug 2018 13:56:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 30 Aug 2018 13:56:48 +0000 (UTC) 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: hw Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Aug 30 15:56:43 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 1fvNRD-0001eq-4k for ged-emacs-devel@m.gmane.org; Thu, 30 Aug 2018 15:56:43 +0200 Original-Received: from localhost ([::1]:49081 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvNTJ-0006Uu-Go for ged-emacs-devel@m.gmane.org; Thu, 30 Aug 2018 09:58:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41489) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvNQq-0002s1-HO for emacs-devel@gnu.org; Thu, 30 Aug 2018 09:56:21 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fvNJm-0006rz-EP for emacs-devel@gnu.org; Thu, 30 Aug 2018 09:49:07 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46792) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fvNJm-0006rr-50; Thu, 30 Aug 2018 09:49:02 -0400 Original-Received: from [176.228.60.248] (port=3774 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1fvNJf-0001SN-0E; Thu, 30 Aug 2018 09:48:56 -0400 In-reply-to: <877ek9oscr.fsf@himinbjorg.adminart.net> (message from hw on Wed, 29 Aug 2018 22:00:52 +0200) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e 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:229099 Archived-At: > 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. > 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. > 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. > 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?