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: Sun, 09 Jul 2023 18:00:37 +0300 Message-ID: <83bkgl9lka.fsf@gnu.org> References: <871qhnr4ty.fsf@localhost> <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> <83cz13g811.fsf@gnu.org> <87lefrbvjw.fsf@localhost> <83h6qfecxt.fsf@gnu.org> <875y6vbiej.fsf@localhost> <834jmeew2u.fsf@gnu.org> <87a5w6aa89.fsf@localhost> <838rbqcvlx.fsf@gnu.org> <87mt058l1b.fsf@localhost> <83mt059tir.fsf@gnu.org> <871qhh891c.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29273"; 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 Sun Jul 09 17:00: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 1qIVuE-0007RN-5O for ged-emacs-devel@m.gmane-mx.org; Sun, 09 Jul 2023 17:00:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qIVtw-0003wP-VP; Sun, 09 Jul 2023 11:00: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 1qIVto-0003rs-Ig for emacs-devel@gnu.org; Sun, 09 Jul 2023 11:00:34 -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 1qIVto-0002a8-5D; Sun, 09 Jul 2023 11:00:32 -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=dZwCcomDu/qxjkWoq1JlU+Q7pMg7UgOl2Ny/hVR/2lc=; b=epzhfYxjWihr 4i4ikNCnV8MqxVxRdGe6phDzqRay4L/h2poPhSCdT8Ge+JJedY83x2B8PdUmk353h/RIIC/zkVveB pHE911ZfASgDVkDmvFoGK/aLx3AUpac1mMow9zep8gGVGQ5HF7pZ9BOKq9LKB4SHlph/tZ2iLO97W vkXvqUqRlBgLSme1+rWTteFoEYVsgdMObpO9p6n4/b2sInzned/HAgZONsCjyQjF5xwgWeTgN420G ZSX/R5UZJU46xjogb1wiCJHK4PMuuZjDiyUAwt4yfPTIRjJ7ujl6HIDXfGxxftYl3sk0YrjH7KmlI rEjF3Fn9eP0nf+kiS8OWbw==; 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 1qIVtm-0004Hb-Up; Sun, 09 Jul 2023 11:00:31 -0400 In-Reply-To: <871qhh891c.fsf@localhost> (message from Ihor Radchenko on Sun, 09 Jul 2023 14:16:31 +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:307686 Archived-At: > From: Ihor Radchenko > Cc: luangruo@yahoo.com, emacs-devel@gnu.org > Date: Sun, 09 Jul 2023 14:16:31 +0000 > > Eli Zaretskii writes: > > >> So, redisplay will have access to correct local values. > > > > No, it won't, because redisplay runs only in the main thread, > > remember? So it will not see changes to Vfoo done by other threads. > > This could sometimes be good (e.g., if the changes are temporary), but > > sometimes bad (if the changes are permanent). > > If redisplay is about to display buffer that is being modified > (including its buffer-local values), it will have to lock until the > modification is done. Same for global Lisp variables. Here goes one more advantage of concurrency, then: while redisplay runs, all the threads that access buffers shown on display will have to block. > >> > What do you expect redisplay to do when some thread moves point in a > >> > way that it is no longer in the window? > >> > >> Async threads will not trigger redisplay. And they will have their own > >> PT, BEGV, and ZV. > > > > This goes back to the other sub-thread, where we discussed how to show > > and prompt the user from non-main threads. The conclusion was that > > there is no good solution to that. The best proposal, wait for the > > main thread, would mean that stuff like stealth fontifications, which > > currently run from timers, cannot be run from a thread. > > May you provide a link? > I am not sure how independent PT+buffer in different threads affects > prompts. No, I meant the "Async threads will not trigger redisplay" part.