From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Akib Azmain Turja Newsgroups: gmane.emacs.bugs Subject: bug#57197: 28.1.90; Can pure side-effect-free functions use multiple CPUs in Elisp? Date: Mon, 15 Aug 2022 11:57:31 +0600 Message-ID: <87a68659ro.fsf@disroot.org> References: <875yiv1mqb.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32964"; mail-complaints-to="usenet@ciao.gmane.io" To: yantar92@gmail.com, 57197@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 15 07:59:19 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oNT8B-0008P1-EB for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Aug 2022 07:59:19 +0200 Original-Received: from localhost ([::1]:50714 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oNT8A-0003TX-Gz for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 15 Aug 2022 01:59:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:45820) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oNT7u-0003Sz-Bo for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2022 01:59:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50630) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oNT7u-00042r-2z for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2022 01:59:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oNT7t-0005VC-Vx for bug-gnu-emacs@gnu.org; Mon, 15 Aug 2022 01:59:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Akib Azmain Turja Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Aug 2022 05:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57197 X-GNU-PR-Package: emacs Original-Received: via spool by 57197-submit@debbugs.gnu.org id=B57197.166054310421086 (code B ref 57197); Mon, 15 Aug 2022 05:59:01 +0000 Original-Received: (at 57197) by debbugs.gnu.org; 15 Aug 2022 05:58:24 +0000 Original-Received: from localhost ([127.0.0.1]:40375 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNT7I-0005U1-8d for submit@debbugs.gnu.org; Mon, 15 Aug 2022 01:58:24 -0400 Original-Received: from knopi.disroot.org ([178.21.23.139]:45354) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oNT7G-0005Tr-Jf for 57197@debbugs.gnu.org; Mon, 15 Aug 2022 01:58:23 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 3C77940076; Mon, 15 Aug 2022 07:58:21 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Original-Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a_2jzaIxc-5I; Mon, 15 Aug 2022 07:58:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1660543098; bh=z96v9pDV2Q/7WuCdHqJXzbaUUNUn5VdPWT6U9sg0Tas=; h=From:To:Subject:In-Reply-To:Date; b=QBwMzDcTDfy3gsz75mznpaqRrKPPzIxqi+9qGxttAyWm7tUPfqClBn6TeSDw3/44A wr3gUi1eqqLmUN5ToecMTMWZDn00bCln4/xban7m1gll6/Itr592P5dOgW0iisfNUi NRZik6YZjZYrENkaAs8E9TJoCxcw8Pm0clqDcJB+wZeIInnCdySGCEvQZW+6NYCMmA TS4bdmh8/9nBOdbyqHDUPLlfOVX1sVF4OC6KaZUWqV8nsP41zBhe65Jg3iYLnVAh/A QytfaiLYp7zY2oZn8vtC/Xup6zl1Mtx6+cu1j7onitg5OIDAzYdB4YcU4l5LFgUuG4 QddJXxFbjQEfg== In-Reply-To: <875yiv1mqb.fsf@localhost> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:239728 Archived-At: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable > Hi, >=20 > The known blocker of Elisp support of multi-threading is shared Elisp > machine state. Handling competing access to global Elisp variables is > tricky. However, it is not the case for pure side-effect-free functions. >=20 > Consider the following code: >=20 > (let (long-list-of-cons) > (dotimes (i 100000) > (push (cons i (1+ i)) long-list-of-cons)) > (mapcar #'car long-list-of-cons)) >=20 > The last mapcar looks like a good candidate to run on multiple CPUs. > I imagine that instead of applying #'car sequentially, Elisp can split > the list in chunks and run them independently on multiple CPUs. This > operation is still blocking and thus will not create issues with shared > access. At the same time such mapcar call will finish much faster. >=20 > Would something like this be feasible to implement in Elisp? >=20 > --=20 > Ihor Radchenko, > Org mode contributor, > Learn more about Org mode at https://orgmode.org/. > Support Org development at https://liberapay.com/org-mode, > or support my work at https://liberapay.com/yantar92 > I think the problem is the interpreter itself, which is not thread-safe. This looks like a feature request, I think emacs-devel is good for that. =2D-=20 Akib Azmain Turja Find me on Mastodon at @akib@hostux.social. This message is signed by me with my GnuPG key. Its fingerprint is: 7001 8CE5 819F 17A3 BBA6 66AF E74F 0EFA 922A E7F5 --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEyVTKmrtL6kNBe3FRVTX89U2IYWsFAmL54EsACgkQVTX89U2I YWvGZw//WPsraF/2R/QzEidQtg2oKzJbPeGyIS8hEJZsrMWUaqH/0QRXC/6cJavJ LTL7mOF/9TzdtaEo1YJrjEsmK4DqTrmjyHOHSAdnjcpN82G/wBmQFBP63SuMTKDr 9f4vDQzXhrlyFhQkOtWvMN79zftppcOsaVrMAmDchfEjPbHGSjfM4tWHFUVWtE6S KFs+U5i0Rdfo4Qrl5TvHBvPVV7fO/vrlmNZpnXZJItQHNQm87CIbuDHQrOlWEchG mxDBbHshP/4tEPUCn/raFxB0VLAAK7YAXYbMylsZ8o36i7gwIxSWtPBtZ0SVGb2R Ypq5UZL6d1rLpMnWm1LusY2RLr6MoWwj5/rFoGEtL7hEZpSbsl5kye755/9Po3op zk2/3/+E8j1mzFFVZJNUYWlKcSXTUhnnvf5Kol3w7n/jU2vm6pH/5t3try2nCzrF QL+oEuoRLdnvbT6EJ6NPTbGMKkOIwQ9RpgdFdao8ZJoY7bK8bCWrHhSNhhnqBgK0 xf3MPVNRFaNn9NjpLG257ZkL+YcGzn5+QOaiwYAGvyWddYSybFaHRP+Zg2egLGZT H6kgS+Y8TyRtnaT0pxEFs4uCsSecYJosKc3QeMuSMjqHA1urrw/f9OthQhW7ECtX HP7NsNg6IXf5vqgkMXGNMqjvftWmOTPG1b8gcbvZqBwu/GeD1OY= =VNDT -----END PGP SIGNATURE----- --=-=-=--