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 2FDF2431FBF; Mon, 23 Nov 2009 18:11:53 -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 Ov4Sn-oQ8iyK; Mon, 23 Nov 2009 18:11:52 -0800 (PST) Received: from cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 778B6431FAE; Mon, 23 Nov 2009 18:11:51 -0800 (PST) From: Carl Worth To: Peter Wang , notmuch@notmuchmail.org In-Reply-To: <20091123110742.GE1496@plug.localdomain> References: <20091123110742.GE1496@plug.localdomain> Date: Mon, 23 Nov 2009 18:11:39 -0800 Message-ID: <87ocms659g.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: 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: Tue, 24 Nov 2009 02:11:53 -0000 On Mon, 23 Nov 2009 22:07:42 +1100, Peter Wang wrote: > 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. Absolutely! I just coded this up on my plane ride home for notmuch.el and it is *fantastic*. It takes notmuch from "OK, as long as your searches don't have a lot of results" to "Blisteringly fast, regardless of what you're doing." And it's not like sup, where you page down and then wait for more search results to page in. Things just keep filling up in the buffer while you're reading and navigating, just as it should be. I'll be cleaning this up and pushing it out soon. I'm very excited about it. > 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. Hmmm... in my code with emacs, I'm just using separate processes, (which seems to be working fine). I haven't looked into Xapian's documentation with regard to threads yet, so I can't actually say how well notmuch's library work with threads yet. > A future concern is how to handle tag updates. Could I open the database > for writing in one thread, and read-only in another? Again, I don't know about the threading yet. But you can definitely open the database read-write in one process while also having it be opened read-only in another. -Carl