From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#41242: Port feature/native-comp to Windows Date: Thu, 14 May 2020 18:48:58 +0000 Message-ID: References: <834ksi60zn.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="22192"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) Cc: 41242@debbugs.gnu.org To: Nicolas =?UTF-8?Q?B=C3=A9rtolo?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 14 20:50:14 2020 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 1jZIvu-0005g6-4X for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 May 2020 20:50:14 +0200 Original-Received: from localhost ([::1]:57644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jZIvs-0006fY-UC for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 May 2020 14:50:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51178) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jZIvj-0006dZ-6P for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 14:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51506) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jZIvi-0007V1-5P for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 14:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jZIvi-00070d-3j for bug-gnu-emacs@gnu.org; Thu, 14 May 2020 14:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 May 2020 18:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41242 X-GNU-PR-Package: emacs Original-Received: via spool by 41242-submit@debbugs.gnu.org id=B41242.158948214426840 (code B ref 41242); Thu, 14 May 2020 18:50:02 +0000 Original-Received: (at 41242) by debbugs.gnu.org; 14 May 2020 18:49:04 +0000 Original-Received: from localhost ([127.0.0.1]:34816 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZIul-0006yp-S8 for submit@debbugs.gnu.org; Thu, 14 May 2020 14:49:04 -0400 Original-Received: from mx.sdf.org ([205.166.94.20]:55023) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jZIuj-0006yG-5e for 41242@debbugs.gnu.org; Thu, 14 May 2020 14:49:01 -0400 Original-Received: from sdf.org (ma.sdf.org [205.166.94.33]) by mx.sdf.org (8.15.2/8.14.5) with ESMTPS id 04EImwmi004782 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits) verified NO); Thu, 14 May 2020 18:48:58 GMT Original-Received: (from akrl@localhost) by sdf.org (8.15.2/8.12.8/Submit) id 04EImw1U017679; Thu, 14 May 2020 18:48:58 GMT In-Reply-To: ("Nicolas =?UTF-8?Q?B=C3=A9rtolo?="'s message of "Thu, 14 May 2020 15:40:28 -0300") 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:180240 Archived-At: Nicolas B=C3=A9rtolo writes: >> Here we are really complexifying a problem that is not. IMO renaming >> and having a list to do the clean-up are sufficient tools to solve it. > > You're right. I just think that renaming and a list do not guarantee that= we > always delete the files when we should. > > Consider this case: > > * Emacs1 and Emacs2 are two Emacs instances that load the > same foo.eln file. > > * Emacs1 decides to recompile foo.el. To do that it renames foo.eln to > foo.eln.old. It creates a new foo.eln and tries to delete foo.eln.old. = It > fails because Emacs2 has an open handle to it. > > * When Emacs2 closes it realizes that foo.eln has been renamed to foo.eln= .old > and deletes it. > > That is the good case. > > If we are unlucky this is what may happen: > > * Emacs2 begins to close. It checks that foo.eln has not been renamed. Th= erefore > it does not delete it. But it does not call FreeLibrary yet. > > * Emacs1 renames foo.eln to foo.eln.old. It tries to delete it but fails = since > Emacs2 has an open handle. > > * Emacs2 finally calls FreeLibrary() and closes. > > In this case we are left over with a stale foo.eln.old. I don't think we = can > have a race free algorithm. > > We could add a "GC" step to `load`, where it tries to find stale .eln.old > files and removes them. > > Nicolas. I see. But I suspect it could work just if each Emacs sessions depose a file to signal is activelly using a certain .eln. The last session can retrive the current filename of the handle and delete it. Do you think it works? --=20 akrl@sdf.org