[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: lmdb: is read operation permitted inside the write transaction?
- To: Dmytro Milinevskyy <dmytro@forgetbox.com>, openldap-devel@openldap.org
- Subject: Re: lmdb: is read operation permitted inside the write transaction?
- From: Howard Chu <hyc@symas.com>
- Date: Tue, 12 May 2015 18:36:19 +0100
- In-reply-to: <CACQ93fCmrZgWAFi5dKFC-LTG6h+GcjpTENqm-w=QLbi-ab6JJA@mail.gmail.com>
- References: <CACQ93fCmrZgWAFi5dKFC-LTG6h+GcjpTENqm-w=QLbi-ab6JJA@mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Firefox/40.0 SeaMonkey/2.37a1
Dmytro Milinevskyy wrote:
Hello,
this might be a trivial question for you but I didn't find anything in the
documentation nor any mention in the examples.
Which examples did you look at? mtest.c (and others) all operate this way already.
Basically I need to have an opportunity to call mdb_get while in write
transaction.
The sequence is smth like:
- txn = mdb_txn_begin(flags=0)
for i in 0..x:
- v = mdb_get(txn, i)
- mdb_put(txn, x+i, v)
- mdb_put(txn, i, v+1)
- mdb_txn_commit(txn)
Will it be always valid data?
Yes.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/