From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E271D431FD0 for ; Fri, 9 Sep 2011 02:28:02 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.09 X-Spam-Level: X-Spam-Status: No, score=-0.09 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, T_MIME_NO_TEXT=0.01] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yi8SurlLrh6r for ; Fri, 9 Sep 2011 02:28:02 -0700 (PDT) Received: from homiemail-a21.g.dreamhost.com (caiajhbdcahe.dreamhost.com [208.97.132.74]) by olra.theworths.org (Postfix) with ESMTP id 56AB2431FB6 for ; Fri, 9 Sep 2011 02:28:02 -0700 (PDT) Received: from homiemail-a21.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTP id 74D0E300074; Fri, 9 Sep 2011 02:28:00 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sspaeth.de; h=from:to:cc:subject :in-reply-to:references:date:message-id:mime-version: content-type; q=dns; s=sspaeth.de; b=H/MyrRbVrjowtj5bxvm/FjpBi3p sPfEbUxoquTx5iSraJSBhpuovdOeg3L/jSj3xpGtuM5PrjLwPVosvaD/KkWZO7oC 3NjTpCHSAnWqjWvYqN6KO+QnQCnznxoUCEqwL0YS9DTWdVQ27G61ikpoQLP/CH03 vMo+JekSj5M0S8sU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sspaeth.de; h=from:to:cc :subject:in-reply-to:references:date:message-id:mime-version: content-type; s=sspaeth.de; bh=Lh9naPi1gWZHljnGPy86n6IGOf4=; b=e mGLl6f9P6y6WH19Kq6oDLgoBsM1ZHY+zauNHWDy178PPmr2TVtpDpPoaDgzlA0nN K5TyCAjMn/zBSNxoGBCOZKH0332rHd3FMzVhRgJKywrjQtLugAA4kwzShHV+uZ+J 3xffsKSYEhxbn1VcGOaga/oSJpwQ0UC/Vo0TNenosQ= Received: from spaetzbook.sspaeth.de (unknown [84.55.211.141]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: fax@sspaeth.de) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTPSA id 47C23300072; Fri, 9 Sep 2011 02:27:58 -0700 (PDT) Received: by spaetzbook.sspaeth.de (sSMTP sendmail emulation); Fri, 09 Sep 2011 11:27:55 +0200 From: Sebastian Spaeth To: Austin Clements Subject: Re: Memory management practices In-Reply-To: <20110908151557.GM5688@mit.edu> References: <8739h1pbaq.fsf@gmail.com> <87pqjprzu2.fsf@gmail.com> <20110829183010.GA2605@24f89f8c-e6a1-4e75-85ee-bb8a3743bb9f> <87liucyn7i.fsf@gmail.com> <87aaag3xaf.fsf@gmail.com> <87zkiff8in.fsf@SSpaeth.de> <20110908151557.GM5688@mit.edu> User-Agent: Notmuch/0.7-19-gee4579a (http://notmuchmail.org) Emacs/23.2.1 (x86_64-pc-linux-gnu) Date: Fri, 09 Sep 2011 11:27:55 +0200 Message-ID: <8762l22hgk.fsf@SSpaeth.de> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Cc: Bertram Felgenhauer , Bart Massey , notmuch X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2011 09:28:03 -0000 --=-=-= On Thu, 8 Sep 2011 11:15:57 -0400, Austin Clements wrote: > In general, a garbage collector can't make any guarantees about > finalization order. When a collection of objects all become > unreachable simultaneously (for example, the last reference to any > Messages object is dropped, causing the Query object and the Message > object to both become unreachable), the garbage collector *could* > finalize the Query first (causing talloc to free the > notmuch_messages_t) and then the Messages object (causing it to > crash). There's no guarantee in general because, in the presence of > cycles, there is no meaningful finalization order. Right, but that should not pose a problem for python. If e.g. both a Query and derived Message objects become unreachable, the python objects would not care which object is ditched and deleted first. Currently, it seems that we finalize the Messages first, and the Query second. But we would not fail if the Query were finalized first. Granted, the underlying libnotmuch Message objects were torn away while the python Message objects were still around. But they would ultimately also be sweeped away, and that would not cause any problems. But I am sure that I am missing out something. I'll leave this discussion to the pros :-). Sebastian --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iEYEARECAAYFAk5p3BsACgkQVYX1jMgnoGIDRwCeMfZX2i6SSnvUe3zcBGZwaXF5 CwQAn1icx+9HaE001I3Fv+4wnGMOubXM =1NuA -----END PGP SIGNATURE----- --=-=-=--