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