[notmuch] Multithreaded access
authorPeter Wang <novalazy@gmail.com>
Mon, 23 Nov 2009 11:07:42 +0000 (22:07 +1100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:41 +0000 (09:35 -0800)
0b/fe577401686574c9b2e6d159cce8eea13320b5 [new file with mode: 0644]

diff --git a/0b/fe577401686574c9b2e6d159cce8eea13320b5 b/0b/fe577401686574c9b2e6d159cce8eea13320b5
new file mode 100644 (file)
index 0000000..80a06d4
--- /dev/null
@@ -0,0 +1,73 @@
+Return-Path: <SRS0=rVGJ=HL=exemail.com.au=tjaden@srs.perfora.net>\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 6E15E431FBC\r
+       for <notmuch@notmuchmail.org>; Mon, 23 Nov 2009 03:07:49 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 sRDBTpsGPmX9 for <notmuch@notmuchmail.org>;\r
+       Mon, 23 Nov 2009 03:07:48 -0800 (PST)\r
+Received: from mout.perfora.net (mout.perfora.net [74.208.4.195])\r
+       by olra.theworths.org (Postfix) with ESMTP id 93947431FAE\r
+       for <notmuch@notmuchmail.org>; Mon, 23 Nov 2009 03:07:48 -0800 (PST)\r
+Received-SPF: pass (mxus0: domain of exemail.com.au designates 220.233.0.70 as\r
+       permitted sender) client-ip=220.233.0.70;\r
+       envelope-from=tjaden@exemail.com.au; helo=pecan2.exetel.com.au; \r
+Received: from pecan2.exetel.com.au (pecan2.exetel.com.au [220.233.0.70])\r
+       by mx.perfora.net (node=mxus0) with ESMTP (Nemesis)\r
+       id 0M4FBr-1O37UO1SUN-00rDFH for notmuch@notmuchmail.org;\r
+       Mon, 23 Nov 2009 06:07:47 -0500\r
+Received: from 27.133.70.115.static.exetel.com.au ([115.70.133.27]\r
+       helo=localhost) by pecan2.exetel.com.au with esmtp (Exim 4.68)\r
+       (envelope-from <tjaden@exemail.com.au>)\r
+       id 1NCWlj-0002Me-00; Mon, 23 Nov 2009 22:07:43 +1100\r
+Date: Mon, 23 Nov 2009 22:07:42 +1100\r
+From: Peter Wang <novalazy@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Message-ID: <20091123110742.GE1496@plug.localdomain>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Content-Disposition: inline\r
+User-Agent: Mutt/1.5.20 (2009-06-14)\r
+Subject: [notmuch] Multithreaded access\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\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: Mon, 23 Nov 2009 11:07:49 -0000\r
+\r
+Hi,\r
+\r
+I am also toying around with a curses frontend for notmuch :-)\r
+One thing that I would really like to have is asynchronous search:\r
+I should be able to begin reading mail even while search results\r
+are rolling in.\r
+\r
+At the moment I'm using one read-only database_t* and creating multiple\r
+queries off it.  There's a background thread[1] slurping up <n> search\r
+results at a time, then passes them to the main thread.  The main thread\r
+also handles the pager.  When the user goes to open a thread, it creates\r
+a separate query_t so that it can look up the messages and their headers\r
+and filenames.\r
+\r
+It seems to work, but sometimes crashes.  I'm wondering if there is\r
+something inherently wrong with this design, so that I should try a\r
+different approach.\r
+\r
+A future concern is how to handle tag updates.  Could I open the database\r
+for writing in one thread, and read-only in another?\r
+\r
+Peter\r
+\r
+[1] Actually, I am playing around with Go at the same time so they are\r
+really goroutines.  Any problems could very well be related to this.\r