From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Newsgroups: gmane.emacs.help Subject: Re: try-this-for ? Date: Thu, 18 Jan 2018 10:27:24 +0100 Message-ID: <20180118092724.GA29536@tuxteam.de> References: <86lggw6vtn.fsf@zoho.com> <86d1277u37.fsf@zoho.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1516267573 12004 195.159.176.226 (18 Jan 2018 09:26:13 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2018 09:26:13 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jan 18 10:26:08 2018 Return-path: Envelope-to: geh-help-gnu-emacs@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 1ec6SR-0002Tp-4X for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 10:26:03 +0100 Original-Received: from localhost ([::1]:46330 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec6UP-0004fI-KD for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 04:28:05 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42920) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec6Tv-0004eU-Ky for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 04:27:36 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ec6Ts-0001Rf-9n for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 04:27:35 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:34945) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ec6Tr-0001Fb-VO for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 04:27:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tuxteam.de; s=20171004; h=From:In-Reply-To:Content-Transfer-Encoding:Content-Type:MIME-Version:References:Message-ID:Subject:To:Date; bh=k8P0nKWw0H3AjkqRGnidesgbd9hQDfpj/P0Li3iQd9k=; b=rFsd6nb75pfaYF5ObOzrlu9IX9fI693FxJhveqDZzbnU/FsFJt9E70I/+sr4Zq+DsW5mQ/KkuvZob7cecvrZWoT2lAEjZVEdmQSynGNNkfdaJlQlRTDhl4wklhdNEmcBiYYX6EayDgk4pbg/VScqVx38fO/IeTJnlx3Myrqnr/HkMDoMvvLdqXndWv6cj96WKIW6QnPX/O6RBmdu2uwEBXrM+AOj0uIE/GGkB8Mzw5XkJuDH2k4fTtzU5Rn5uwk5ffPWYorPZKhykTwLD8sr7LL3YBv1y0ZK0LjgywPKO/7959VwLIqelmAL55gsN9eowi7fV8YRcELESaxZoJ7JRw==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1ec6Tk-00089H-Cy for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 10:27:24 +0100 In-Reply-To: <86d1277u37.fsf@zoho.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:115770 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, Jan 18, 2018 at 03:56:44AM +0100, Emanuel Berg wrote: [...] > Right, I suspected that... so what I ask for > perhaps cannot be done because of the very > architecture? There is no preemption, > only collaboration? There be dragons. Or dragons and mad cows. Up to now, Emacs Lisp's model of concurrency seems to be explicitly cooperative. The two spots in the manual to start with ("Special Events" [0] and, in a more modern Emacs version "Threads" [1] hint at this. Currently it seems to be a basic limitation of the interpreter, although the verbiage in [1] suggests that there is an active will to change that. So if you want to get "signals" right deep in your search for the next Mersenne prime, you'll have to embed some form of "yield" [2] in your calculation. But if you alre already "yielding" at strategic spots in your Mersenne quest, you can as well consult your watch (i.e. give the timer functions a chance to run), so you don't need signals, threads or other exotica for that [3]. Believe me, this is the easier part, and if you plan carefully and develop some sense of aesthetics it comes about pretty organically. The dragons are elsewhere. Cows? I never said anything about them, oh, no. Cheers [0] https://www.gnu.org/software/emacs/manual/html_node/elisp/Special-Events.html#Special-Events [1] http://git.savannah.gnu.org/cgit/emacs.git/tree/doc/lispref/threads.texi?h=emacs-26 [2] https://en.wikipedia.org/wiki/Generator_(computer_programming) [3] What do I need threads for, then? For one, if you want to wield more computing power in one process: remember, the box you bought has at least two cores, and each core not dedicated to Emacs is one core wasted. - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlpgaHwACgkQBcgs9XrR2kaDXwCdGWfdXn/4Ymm83RKSwzX8/7hl 4IoAn3ZiADkHIlI+YeU2YJV2dj6XdEsw =3VTm -----END PGP SIGNATURE-----