From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Concurrency via isolated process/thread Date: Sat, 08 Jul 2023 17:45:43 +0300 Message-ID: <837cracvhk.fsf@gnu.org> References: <871qhnr4ty.fsf@localhost> <87cz16o8vz.fsf@yahoo.com> <87jzve8r4m.fsf@localhost> <871qhmo5nv.fsf@yahoo.com> <87bkgq8p5t.fsf@localhost> <831qhmjwk0.fsf@gnu.org> <875y6y8nlr.fsf@localhost> <87h6qhnalc.fsf@yahoo.com> <87ilax71wo.fsf@localhost> <831qhli14t.fsf@gnu.org> <87wmzdxewc.fsf@localhost> <83r0plgjeo.fsf@gnu.org> <87o7kpxapo.fsf@localhost> <83mt09gcaf.fsf@gnu.org> <87wmzbc3af.fsf@localhost> <87edljhmjq.fsf@yahoo.com> <87fs5zbuwn.fsf@localhost> <871qhjgrku.fsf@yahoo.com> <831qhieumz.fsf@gnu.org> <87lefqg7yl.fsf@yahoo.com> <83h6qed8kw.fsf@gnu.org> <877craa9z7.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6230"; mail-complaints-to="usenet@ciao.gmane.io" Cc: luangruo@yahoo.com, emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Jul 08 16:45:58 2023 Return-path: Envelope-to: ged-emacs-devel@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 1qI9CA-0001Q7-8I for ged-emacs-devel@m.gmane-mx.org; Sat, 08 Jul 2023 16:45:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qI9Bs-0004Tu-N8; Sat, 08 Jul 2023 10:45:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qI9Bq-0004SO-M1 for emacs-devel@gnu.org; Sat, 08 Jul 2023 10:45:38 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qI9Bq-0005bG-Cr; Sat, 08 Jul 2023 10:45:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=nB2oD8hMRNqURACxP21xuNgNvQ/T24hDNdtYnPWA3Bw=; b=bYPLanzArUnr zIQUxTfse7R8oi9OxcSJXOOektx8tOcvLVkEe6xPOctg7DpYxSmgqQclmmcT8xilWLnV5jkBWSd3Z KOG68LJC9eJYgsmLd4kGs1j69hsuKukMiUxcZ1NMib7G80MneiqpnxbBNgfT45xkHaoMrWFrWZNNT stIiZvYzvsufQZ82gIknef+diPqpHzdW4uKte9FLJ6QODEejawatMdDVk5IYfknelbprUf8WW8TBc p4vuhzQrQe3RHu5bzfxms061BtkxkZiPZPuFscm5WJxhAQ90jOW1zwKa25zO6r2g0UQm8ocLlzQV/ NUe6hgfg5LJjaOrffQasjA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qI9Bp-0006n9-T4; Sat, 08 Jul 2023 10:45:38 -0400 In-Reply-To: <877craa9z7.fsf@localhost> (message from Ihor Radchenko on Sat, 08 Jul 2023 12:01:00 +0000) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:307617 Archived-At: > From: Ihor Radchenko > Cc: Po Lu , emacs-devel@gnu.org > Date: Sat, 08 Jul 2023 12:01:00 +0000 > > Eli Zaretskii writes: > > >> > That is already a problem, as long as we are talking about leaving > >> > most of Emacs application code intact. How do you ensure only the > >> > main thread can process input and display? A non-main thread can > >> > easily call some function which prompts the user, e.g., with > >> > yes-or-no-p, or force redisplay with sit-for, and what do you do when > >> > that happens? > >> > >> To signal an error. > > > > Great! that means in practice no existing Lisp program could ever run > > in a non-main thread. It isn't a very practical solution. > > > > Besides, non-main threads do sometimes legitimately need to prompt > > the user. It is not a programmer's error when they do. > > As an alternative async threads can be temporarily changed to > cooperative in such scenario. That doesn't help, because, as I said, we don't have a good solution for this dilemma even for the current Lisp threads. > They will already have to wait synchronously when consing new objects > anyway. This issue about display and prompting the user is not the same as interlocking. The latter can be solved by waiting, but the former cannot.