[PATCH v4 0/7] emacs: Improve the cited message included in replies
[notmuch-archives.git] / 69 / c8da6a7fee99b3299e10046583f35db24945a6
1 Return-Path: <pioto@pioto.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 1D875431FB6\r
6         for <notmuch@notmuchmail.org>; Fri, 28 Jan 2011 07:36:29 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id uMgSfrsaY5-T for <notmuch@notmuchmail.org>;\r
16         Fri, 28 Jan 2011 07:36:27 -0800 (PST)\r
17 Received: from everglades.pioto.org (mail.pioto.org [207.192.71.235])\r
18         by olra.theworths.org (Postfix) with ESMTP id 5A934431FB5\r
19         for <notmuch@notmuchmail.org>; Fri, 28 Jan 2011 07:36:27 -0800 (PST)\r
20 Received: by everglades.pioto.org (Postfix, from userid 1000)\r
21         id 111AD16170F; Fri, 28 Jan 2011 10:36:16 -0500 (EST)\r
22 From: Mike Kelly <pioto@pioto.org>\r
23 Subject: Re: notmuch's idea of concurrency / failing an invocation\r
24 To: notmuch@notmuchmail.org\r
25 References: <87fwsetdin.fsf@kepler.schwinge.homeip.net>\r
26         <8762taxk9y.fsf@algae.riseup.net>\r
27         <87vd1a84qj.fsf@servo.finestructure.net>\r
28         <AANLkTi=pPgcPXUN_XTXa0gAkbTR_OF4XxCP-d4-Be2pt@mail.gmail.com>\r
29         <87fwsdobpy.fsf@yoom.home.cworth.org>\r
30         <877hdps6og.fsf@kepler.schwinge.homeip.net>\r
31 In-Reply-To: <877hdps6og.fsf@kepler.schwinge.homeip.net>\r
32 MIME-Version: 1.0\r
33 Date: Fri, 28 Jan 2011 15:36:15 +0000\r
34 Message-Id: <1296228975-ner-3626@everglades>\r
35 Content-Type: text/plain\r
36 X-BeenThere: notmuch@notmuchmail.org\r
37 X-Mailman-Version: 2.1.13\r
38 Precedence: list\r
39 List-Id: "Use and development of the notmuch mail system."\r
40         <notmuch.notmuchmail.org>\r
41 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
43 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
44 List-Post: <mailto:notmuch@notmuchmail.org>\r
45 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
46 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
47         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
48 X-List-Received-Date: Fri, 28 Jan 2011 15:36:29 -0000\r
49 \r
50 On Fri, 28 Jan 2011 10:45:19 +0100, Thomas Schwinge <thomas@schwinge.name> wrote:\r
51 > > It would definitely be nice to avoid the complexity inherent in having a\r
52 > > daemon, but how do you imagine "queue on a lock" to work? We don't have\r
53 > > anything like that in place now.\r
54 >\r
55 > I suppose what he means is trying to get the lock, and if that fails wait\r
56 > a bit / wait until it is available again.\r
57 >\r
58 > Actually, as a next step, wouldn't it also be possible to add some\r
59 > heuristic to avoid ``notmuch new'' (being a low-priority task) blocking\r
60 > some interactive user (UI; high-priority task)?  But we can pursue such\r
61 > schemes as soon as the basic infrastructure is in place.\r
62 \r
63 Couldn't we pretty much get the desired behavior by using flock(2)?\r
64 Basically, take out a LOCK_EX when we need to write, and a LOCK_SH when\r
65 we only need to read. Using the blocking form, things should pretty much\r
66 just queue up and take their turn, right?\r
67 \r
68 I'm not familiar with Xapian, but if it doesn't give us something we\r
69 could use this sort of locking on, couldn't we just add some\r
70 /path/to/mail/.notmuch.lock file that we open to hold a lock on?\r
71 \r
72 We already have to specify if we want a read-only or read-write database\r
73 handle in notmuch_database_open, so it seems like it'd be easy enough to\r
74 hook in there.\r
75 \r
76 -- \r
77 Mike Kelly\r