Re: one-time-iterators
authorAustin Clements <amdragon@mit.edu>
Thu, 26 May 2011 20:18:53 +0000 (16:18 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:23 +0000 (09:38 -0800)
f5/681ef570d7e40e5375e4f39a3da5dc7e8bdc81 [new file with mode: 0644]

diff --git a/f5/681ef570d7e40e5375e4f39a3da5dc7e8bdc81 b/f5/681ef570d7e40e5375e4f39a3da5dc7e8bdc81
new file mode 100644 (file)
index 0000000..cc1140d
--- /dev/null
@@ -0,0 +1,107 @@
+Return-Path: <amdragon@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 566D1429E28\r
+       for <notmuch@notmuchmail.org>; Thu, 26 May 2011 13:18:55 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.699\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.699 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id l1k6gRNVKev9 for <notmuch@notmuchmail.org>;\r
+       Thu, 26 May 2011 13:18:54 -0700 (PDT)\r
+Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com\r
+       [209.85.216.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 6EDFB431FB6\r
+       for <notmuch@notmuchmail.org>; Thu, 26 May 2011 13:18:54 -0700 (PDT)\r
+Received: by qwb7 with SMTP id 7so723465qwb.26\r
+       for <notmuch@notmuchmail.org>; Thu, 26 May 2011 13:18:53 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:mime-version:sender:in-reply-to:references:date\r
+       :x-google-sender-auth:message-id:subject:from:to:cc:content-type\r
+       :content-transfer-encoding;\r
+       bh=GEFCyn1hdkFdnm9bJLZnOPjUk7Km+3iLvPG5ntw8ZdU=;\r
+       b=hnUXrYC75xY8g79i4Jb5IauqrYAN0X1YMXJtI7oZLwQk1CXachC7I0Kr729r0eaHyZ\r
+       4b2liaSTK7sOgyd8ARTxHCurpSKr+FlBoIqjHSTFJ4jOwsxMbYu5YSL+iGhWTeCLyeOZ\r
+       PmWFIzcFv26HpA5P134lCaz6zvDes2zM2tdg8=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=mime-version:sender:in-reply-to:references:date\r
+       :x-google-sender-auth:message-id:subject:from:to:cc:content-type\r
+       :content-transfer-encoding;\r
+       b=eWithQF5A6v2jJCJU5f5qtp8L5Fv4G7lZQwQwim+dM4OOuuaD2Gu3AGpnH13Ql7Ysn\r
+       CbwatW2PGHzUcHY4OTR5duQ08ABN0igl7EsJC28A9SUEErNdLzE63izd3ZawZanMLAI6\r
+       xdLW7fa5DC+JFYEY+F/nQ23zmgt/x5f11H21o=\r
+MIME-Version: 1.0\r
+Received: by 10.229.142.11 with SMTP id o11mr1003970qcu.46.1306441133374; Thu,\r
+       26 May 2011 13:18:53 -0700 (PDT)\r
+Sender: amdragon@gmail.com\r
+Received: by 10.229.188.68 with HTTP; Thu, 26 May 2011 13:18:53 -0700 (PDT)\r
+In-Reply-To: <877h9d9y5m.fsf@yoom.home.cworth.org>\r
+References: <1306397849-sup-3304@brick> <877h9d9y5m.fsf@yoom.home.cworth.org>\r
+Date: Thu, 26 May 2011 16:18:53 -0400\r
+X-Google-Sender-Auth: f8JApCG5-0jsiDTITBVtmmMXEbU\r
+Message-ID: <BANLkTi=3mQYJft4s9jGaoqSbcJvqhmZXyQ@mail.gmail.com>\r
+Subject: Re: one-time-iterators\r
+From: Austin Clements <amdragon@mit.edu>\r
+To: Carl Worth <cworth@cworth.org>,\r
+       Patrick Totzke <patricktotzke@googlemail.com>\r
+Content-Type: text/plain; charset=ISO-8859-1\r
+Content-Transfer-Encoding: quoted-printable\r
+Cc: notmuch <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 26 May 2011 20:18:55 -0000\r
+\r
+On May 26, 2011 1:20 PM, "Carl Worth" <cworth@cworth.org> wrote:\r
+> > The question: How do you solve this in the emacs code?\r
+> > do you store all tids of a query?\r
+>\r
+> The emacs code does not use the notmuch library interface like your\r
+> python bindings do. Instead, it uses the notmuch command-line tool, (and\r
+> buffers up the text output by it). The support for asynchronous\r
+> operations in the emacs interface means that it's likely possible\r
+> someone could run into a similar problem:\r
+>\r
+> =A0 =A0 =A0 =A01. Start a search returning a *lot* of results\r
+>\r
+> =A0 =A0 =A0 =A02. When the first results come in, make some tag changes\r
+>\r
+> =A0 =A0 =A0 =A03. See if the original search aborts\r
+>\r
+> I may have even had this happen to me before, but if I did I've never\r
+> actually noticed it. I don't know what a good answer might be for this\r
+> problem.\r
+\r
+I proposed a solution to this problem a while ago\r
+(id:"AANLkTi=3DKOx8aTJipkiArFVjEHE6zt_JypoASMiiAWBZ6@mail.gmail.com"),\r
+though I haven't tried implementing it yet.\r
+\r
+Though, Patrick, that solution doesn't address your problem.=A0 On the\r
+other hand, it's not clear to me what concurrent access semantics\r
+you're actually expecting.=A0 I suspect you don't want the remaining\r
+iteration to reflect the changes, since your changes could equally\r
+well have affected earlier iteration results.=A0 But if you want a\r
+consistent view of your query results, something's going to have to\r
+materialize that iterator, and it might as well be you (or Xapian\r
+would need more sophisticated concurrency control than it has).=A0 But\r
+this shouldn't be expensive because all you need to materialize are\r
+the document ids; you shouldn't need to eagerly fetch the per-thread\r
+information.  Have you tried simply calling list() on your thread\r
+iterator to see how expensive it is?  My bet is that it's quite cheap,\r
+both memory-wise and CPU-wise.\r