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: Emacs design and architecture. How about copy-on-write? Date: Mon, 18 Sep 2023 17:27:51 +0300 Message-ID: <83ttrreeu0.fsf@gnu.org> References: <83edizjn0v.fsf@gnu.org> <0518f65b-1dd1-6923-8497-da4d3aeac631@gutov.dev> <87sf7fc7kd.fsf@dataswamp.org> <834jjuk68t.fsf@gnu.org> <87cyyhc7uu.fsf@dataswamp.org> <83ttrsg9nx.fsf@gnu.org> <83h6nrg4eg.fsf@gnu.org> <83v8c7elan.fsf@gnu.org> <877conk5ny.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13999"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, incal@dataswamp.org, emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Sep 18 16:29:06 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 1qiFFI-0003PL-4X for ged-emacs-devel@m.gmane-mx.org; Mon, 18 Sep 2023 16:29:04 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qiFEP-0006id-4y; Mon, 18 Sep 2023 10:28:09 -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 1qiFEM-0006iM-Sx for emacs-devel@gnu.org; Mon, 18 Sep 2023 10:28:06 -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 1qiFEJ-000847-NH; Mon, 18 Sep 2023 10:28:04 -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=NxYmnh4qzM40hhNua3aLTed5aX0TK4JG03Z1fDFUHTk=; b=QwfoMRJWC3G6 nPiUqFYzrX9C1rIlmir3bxL3qN0MUxKt7J6epMuVD7Yn9kBojQ5PvvRwCD8aks1FNlnTrCN2NYVWf cAm+K+0JnVD24Hl7bW0xaYPO8yKJxwrbljuMNO2IKEBc0UvBHb3kKWFKAprOnaDBVJOfLaNtFeuTb GrbmsQw+SOTn7EVgz4iktZCKOYnamOHOgDFLTTlb0gh15QrjXSpJasXlDowTLoZugn+s6xXZu7lbk z0Mk6TLCp8puvbUxmK3WCamkU7Ox2r7gekO5dIiGwc/I5x48sJS7IRURnxWxOIQj8P3oF3LDbw3aN v7SAxpFqFiMxpIjnU9WULw==; In-Reply-To: <877conk5ny.fsf@localhost> (message from Ihor Radchenko on Mon, 18 Sep 2023 12:49:21 +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:310702 Archived-At: > From: Ihor Radchenko > Cc: Alan Mackenzie , incal@dataswamp.org, emacs-devel@gnu.org > Date: Mon, 18 Sep 2023 12:49:21 +0000 > > > I'm confused: suppose one thread modifies scroll-margin -- does that > > affect the (global) redisplay? If it does, how will this "solve" the > > problem? If it doesn't affect redisplay, how _can_ a thread change > > scroll-margin in order to affect redisplay? > > IMHO, the only sane way to utilize the existing redisplay is redisplay > lock - only one thread can request redisplay at a time, using its > thread-local state. So if one thread changes scroll-margin and triggers redisplay, then another thread triggers redisplay with its (different value of scroll-margin), the display will scroll or move point back? and then forward again? and then back again? > >> I don't think several redisplay threads would be a good idea - usually, > >> there is just one screen Emacs is drawing on. > > > > It's one screen, but each window is redrawn separately (on GUI > > terminals). > > Technically yes, but AFAIU the code is written assuming single-threaded > execution. In what way does it assume single-threaded execution? We walk the window tree of a frame and redisplay each leaf window in the tree, that's all. Maybe I don't understand what you mean by "assuming single-threaded execution". > Decoupling redisplay of different windows would require significant > non-trivial changes in xdisp.c In which part(s) of xdisp.c? Most of xdisp.c handles redisplay of a single window.