[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: mdb_dbi_open and threads
- To: Howard Chu <hyc@symas.com>
- Subject: Re: mdb_dbi_open and threads
- From: Muhammed Muneer <elendilm@gmail.com>
- Date: Mon, 19 Jun 2017 14:01:03 +0530
- Cc: Hallvard Breien Furuseth <h.b.furuseth@usit.uio.no>, openldap-technical@openldap.org, Klaus Malorny <Klaus.Malorny@knipp.de>
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=00/syjhGsIbToDyQ/H/PS3UfLy7dLUfPj7lwYPy60cs=; b=cpU6lvBwLjkQQbkB1CpppQ8vDXpyJHKDBGma9j2vFVJwZl1AzsQh9Ze0YC8Ch7X5mv w69Rij3ZUE4jA+LTzqY6i0mrLkPcO5B9s8Rya0N9Ktbb6tIASHTTauO0JJqjTSX6O3b0 59M+zCK1VTmnLvNQTo9duQtu5vicUSKM0j+5+nOMN4Amhg8o1QTlbOVJv0WWUH1ThX9t TyZzggjNmLCvEJewhSRprflbvlgGI+OqWrO3gO4zwuntVJ8lrZhgyuVHuhG1nsPI9a+A Eea+SiLN3Q/lK3eZx1p/CZk01PvVYz+ou6YB802DXrhYXpsHDSQAth+6aeUy3z5MBNQ1 Vd7g==
- In-reply-to: <8db837aa-51bf-39af-1217-55d69cc20099@symas.com>
- References: <CAMvTE2PoED94-ZiGjCHt+akiYSjqQvFqkYe3Z7DHdkGdcwdSQA@mail.gmail.com> <CAMvTE2Nb7r3gnJUmkK8OeSM1EOigDdKAoznG8J0UXUH1KGi-Zw@mail.gmail.com> <WM!424f52a64e09ca72b70a15ea86bff780c4b3988fadb73ec6db8fc6baeb715772d9748466a1c064aba3b97839add80e4c!@mailstronghold-2.zmailcloud.com> <450e4835-9c54-0c5c-29cd-ab081eee8bd0@symas.com> <CAMvTE2N2k-O-_f-u-ChdBv+BZmkkidqUMsp4pp9PmcWRSOaCiA@mail.gmail.com> <CAMvTE2MjUBZ0YdzYxXVUnDGuawicuUDH3Y4Vy-pt3PidFgxrXg@mail.gmail.com> <4ee53713-f261-7efe-97cb-66e834f0f86b@knipp.de> <CAMvTE2OdV_MxeH=F1NfTjSOXe48zow330v4e1c185yvVedeREg@mail.gmail.com> <WM!fca24ec35fb2ea6029fe6df0c81746209810835b76c57bfceee80ab2ef6796789549c5df115c82370b14612c57e1d98e!@mailstronghold-1.zmailcloud.com> <611b7680-366a-6ad6-3b6f-47922bf88940@symas.com> <f7441608-0c22-6ebd-5c85-dde1ead68fdd@usit.uio.no> <WM!233e16a5e3ba4174ba4546004358dfbbf29cec9059486b9a0982c3561a2342529c272b5c17bbce035ad5074ff377f5a3!@mailstronghold-3.zmailcloud.com> <8db837aa-51bf-39af-1217-55d69cc20099@symas.com>
Sorry for the late reply, I was on vacation.
Klaus wrote:
"I am still unsure what you are trying to achieve. If you are in a read transaction and discover that your database does not exist, what can you do anyway? You cannot create the database at this point, since it is a write operation."
When I discover a dbi does not exist in a read transaction, I can assume it to be the same as a dbi which is empty and create it when and only when there is a write-request into that dbi later.
Howard wrote:
"If you want to use dbi_open in multiple threads then put it in your own wrapper function, protected by a mutex."
This defeats the whole purpose of parallel reads.
Hallvard wrote:
"Anyway, just forget about being clever with DBIs. LMDB does not support DBI cleverness"
There is nothing clever about opening a dbi on the fly. Its a normal requirement especially when the database handles multiple clients.
Imagine a server database listening in on clients.
The server issues a write request from Client A and dbi_open ABC and is about to write data.
At the same time in another thread, it issues a read request from Client B to the same dbi ABC but is
unable to dbi_open ABC.
Isn't this scenario one of the basic requirements of a database listening in on clients.