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: Threading IO-bound functions Date: Fri, 16 Dec 2016 17:26:57 +0200 Message-ID: <8360mj99oe.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1481902078 883 195.159.176.226 (16 Dec 2016 15:27:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 16 Dec 2016 15:27:58 +0000 (UTC) Cc: emacs-devel@gnu.org To: Elias =?utf-8?Q?M=C3=A5rtenson?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Dec 16 16:27:52 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 1cHuQJ-0007O2-Rt for ged-emacs-devel@m.gmane.org; Fri, 16 Dec 2016 16:27:51 +0100 Original-Received: from localhost ([::1]:32832 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHuQO-0003Np-9e for ged-emacs-devel@m.gmane.org; Fri, 16 Dec 2016 10:27:56 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55608) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHuQB-0002tB-Dg for emacs-devel@gnu.org; Fri, 16 Dec 2016 10:27:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cHuQ7-0002x1-Es for emacs-devel@gnu.org; Fri, 16 Dec 2016 10:27:43 -0500 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:54878) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cHuQ7-0002wv-Bd; Fri, 16 Dec 2016 10:27:39 -0500 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2894 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1cHuQ6-0001De-Iu; Fri, 16 Dec 2016 10:27:39 -0500 In-reply-to: (message from Elias =?utf-8?Q?M=C3=A5rtenson?= on Thu, 15 Dec 2016 12:01:51 +0800) 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:210519 Archived-At: > From: Elias Mårtenson > Date: Thu, 15 Dec 2016 12:01:51 +0800 > > The number one function that I call that sometimes hang for a significant amount of time is ‘gnus’. I decided to > try running it in a thread, and it worked surprisingly well. Initial loading of the messages can now be done in the > background. Beginner's luck ;-) Did you try this in "emacs -nw"? And without your Gnus customizations, which allow some shortcuts? Half way through its initialization, Gnus asks a question, and then you get bug#25214. > To prevent myself from running this function more than once at the same time, I created a wrapper function > for this, and I have extracted it into a macro. Thanks. > I'd like to have people's opinions on this strategy, and if it might be reasonable to default ‘gnus’ to do this when > run on Emacs versions with concurrency support. I think we need first to solve the above problem in some way. Or change Gnus to not ask any questions from a background thread.