[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: Multiple threads and mdb_dbi_open
- To: Harry B <harrysungod@gmail.com>, openldap-technical@openldap.org
- Subject: Re: Multiple threads and mdb_dbi_open
- From: Howard Chu <hyc@symas.com>
- Date: Fri, 12 Sep 2014 00:35:08 +0100
- In-reply-to: <CAMG7=yVevhhEB3QCXqu01+4vXC8qvVS9PCyCtGNZJQ4MPORpiw@mail.gmail.com>
- References: <CAMG7=yVevhhEB3QCXqu01+4vXC8qvVS9PCyCtGNZJQ4MPORpiw@mail.gmail.com>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:30.0) Gecko/20100101 Firefox/30.0 SeaMonkey/2.27a1
Harry B wrote:
Hello,
As per the documentation here
http://symas.com/mdb/doc/group__mdb.html#gac08cad5b096925642ca359a6d6f0562a
I see the following,
"This function must not be called from multiple concurrent transactions. A
transaction that uses this function must finish (either commit or abort)
before any other transaction may use this function."
This seems to imply that after one txn has begun on an environment, I cannot
create another txn or dbi until the first one has finished - that doesn't seem
to be right.
If I have multi-threaded app, what is the expected sequence for creation of
Environment, Transaction, and DBI handles?
Before starting any other threads:
Create the environment.
Open a transaction.
Open all DBI handles the app will need.
Commit the transaction.
After that use the DBI handles freely among any transactions/threads.
Any help is appreciated.
--
Harry
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/