From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Peter Dean Newsgroups: gmane.emacs.devel Subject: Re: [External] : Re: Would you say this information window is well designed? Date: Tue, 23 Feb 2021 21:58:46 +0000 Message-ID: References: <835z2ivknw.fsf@gnu.org> <83sg5mu1hn.fsf@gnu.org> <83r1l6tzbo.fsf@gnu.org> <83pn0qtvn1.fsf@gnu.org> Reply-To: Peter Dean Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31411"; mail-complaints-to="usenet@ciao.gmane.io" Cc: "drew.adams@oracle.com" , "stefankangas@gmail.com" , "larsi@gnus.org" , "dgutov@yandex.ru" , "emacs-devel@gnu.org" To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 23 22:59:38 2021 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 1lEfiT-00085O-AL for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Feb 2021 22:59:37 +0100 Original-Received: from localhost ([::1]:48320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lEfiS-00088d-Au for ged-emacs-devel@m.gmane-mx.org; Tue, 23 Feb 2021 16:59:36 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:37116) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEfhr-0007Yv-VM for emacs-devel@gnu.org; Tue, 23 Feb 2021 16:58:59 -0500 Original-Received: from mail-40138.protonmail.ch ([185.70.40.138]:35918) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lEfhp-0002Df-PQ for emacs-devel@gnu.org; Tue, 23 Feb 2021 16:58:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1614117535; bh=B7E0+d8F7vYfaYHFx1JzZ+WEnGYJGmGKvUYztmQB/M4=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=Nl478ldHh8TCcUD+AJ/hmOEVSHFnAlFxP0ThVv9AUxGjDQH0GQNQdAvUJlVZ3elmy 52RZrNLsxIgKsuBJkxWNkMWA7M7KQ96Ehx2AY1SP2D9Gj2LjwYOhA1UunWFlfBrgzT 9E5LmGagqzqDqlw/1OIWB7hZi9PBzPu0ZMdFywPk= In-Reply-To: <83pn0qtvn1.fsf@gnu.org> Received-SPF: pass client-ip=185.70.40.138; envelope-from=laszlomail@protonmail.com; helo=mail-40138.protonmail.ch X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:265554 Archived-At: > > Why the main thread? The UI could be run in any thread, not > necessarily in the main one. There's no way to know in advance which > one will run it. OK, then how about this: we start a thread which has the only job of keeping the UI updated. It has high priority and when it is scheduled it checks when was the UI last updated. If it's within the refresh rate then it yields to other threads without doing anything. Othwerise, it updates the UI and then yields. > And finally, if you give the main thread higher priority up front, how > can we make sure the other threads will ever get to run? It is the job of the scheduler to make sure lower priority threads are not starved, so it takes care of this.