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 13:43:37 +0100 Message-ID: <20180118124337.GC29536@tuxteam.de> References: <86lggw6vtn.fsf@zoho.com> <86d1277u37.fsf@zoho.com> <86r2qn5qby.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 1516279490 22630 195.159.176.226 (18 Jan 2018 12:44:50 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 18 Jan 2018 12:44:50 +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 13:44:46 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 1ec9YY-00051j-UZ for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 13:44:35 +0100 Original-Received: from localhost ([::1]:56647 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec9aY-0002mb-Ro for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Jan 2018 07:46:38 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec9Xk-0000zx-Em for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 07:43:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ec9Xg-0004Ns-Go for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 07:43:44 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:35342) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ec9Xg-0004N6-6k for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 07:43:40 -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=DMg/O7by6VNRrnYwzo7F34z/Km07MTBEOEy+l+vOn9Y=; b=NqV69A4FynSuxJy7VbJhrd3/foVAgH8+bu/GUdFGaBYCC9hQ2k/oGVN40BwzFaz3Rbq+VGyBuIgF6vnxyxvQkMnAuxrEUnjG9kb2ifOyYAt2MMtTbxlFoRVWtUha2ku4jTY2gmFFNiuyEkAqbhV0LWW/oc772/z0dlTEMqfV++2eMRkqs+IEkGLUuzDs6zoReleviO4fI97F5x2WI8tFn2Je90tRrAMXyI7xQjaryKHCpFK1XxAN7vp4w7ZiErFoA+4RerOu4mMOG/OTlR1vOe+ZRjuvqWd5/JCrDxXr/c1PcCnB+TWWemC8GEFeztgRM0oN1W97FWwhz27bZnv+qQ==; Original-Received: from tomas by mail.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1ec9Xd-0001G9-Ps for help-gnu-emacs@gnu.org; Thu, 18 Jan 2018 13:43:37 +0100 In-Reply-To: <86r2qn5qby.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:115774 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Thu, Jan 18, 2018 at 01:00:49PM +0100, Emanuel Berg wrote: > tomas wrote: > > > Up to now, Emacs Lisp's model of concurrency > > seems to be explicitly cooperative. > > "seems to be explicitly" :) ? (seems to be (explicitly cooperative)) With explicitly I meant that control is not taken away behind a process's back, but the process has to explicitly yield control. > True concurrency isn't possible even for > multicore architectures IIUC. To a certain extent yes: the processors/cores have to cooperate to access common resources (e.g. memory), but as long as they are operating e.g. from local cache they do run in parallel. > The perceived concurrency, how does that work > if it isn't Unix-style preemptive with > priorities and a scheduler etc.? As far as I know, the only (implicit) yield point in Emacs is the event loop, but many things fit in there: waiting for key events, waiting for file descriptors to become readable/writable (e.g. communicating with (operating system) subprocesses, reacting to POSIX signals, the idle timer, etc. > For example, with `list-processes', is that > really all cooperative stuff handled by the > idle timer? Not really the idle timer: this one is (probably?) triggered from the central event loop, as the others. But the great Eli has answered that already in emacs devel some moons ago [1]. Turns out that what I call "event loop" is called the "input queue". If you have a lengthy calculation and want the other things (user input, but also file notifications, communication via sockets, etc) to "keep running", you have to explicitly (that's the "explicit" part in what I labeled as "explicitly cooperative") give a chance to this input queue to run from time to time. Perhaps (sit-for 0) is your friend (it would trigger a redisplay), perhaps something else. Cheers [1] https://lists.gnu.org/archive/html/emacs-devel/2014-10/msg00922.html - -- tomás -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlpglnkACgkQBcgs9XrR2kbsIwCfXg9pI1PRDrdljTab+Tuf6VJU /BcAn0IplpC0UqNCPzfcOqcpW0Nd7034 =+CsX -----END PGP SIGNATURE-----