[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
lmdb - atomic actions
- To: openldap-technical@openldap.org
- Subject: lmdb - atomic actions
- From: Tomer Doron <tomer.doron@gmail.com>
- Date: Wed, 24 Jul 2013 13:09:59 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:content-type:content-transfer-encoding:subject:message-id:date :to:mime-version:x-mailer; bh=GeY42wQnOm0E2CWLQ2Xr21vwlMMd2KomgW0/foH8ick=; b=FXLTHS2vcDcAO+ZN561cXdq3CzuI20AMmsYY/y2I+SAYzaXhVaTR8HfrPESzAbRYuL Y94SW30cotf2Ru8ObbSlOa8wKpzca9zWu1PJbm0s7PozLCZORQIeUy/n+vyW2Ff9z6xD +GWEt7DQfeOg6CZ4GwTCcZcSZiAQQPPFf2KLmTXiV3H3vfI3axhPsIpImtrozHbwSI6z rbrY+UX68hPr9++ZFK1YeqvBvNR2yfgR58pYfDyBoUVH3YN7RCq2Wtdkoq0ToztS8kYu sX8Ka8vRAuxtxRb8ipaKx8maoNucB7/6UoBG46Fhmw/1GBGnJ/fSt+4c8zmt8ZyoUEmK IS2Q==
wondering what the best strategy to achieve atomic updates with LMDB.
what i am trying to achieve is a read then update atomic action given a highly concurrent use case, for example, if a key/value pair represents a counter, how does one increment or decrement the counter atomically.
i am pretty sure mdb_get -> mdv_set sequence is not atomic, wondering if mdb_cursor_get -> mdv_cursor_put sequence is? perhaps a certain flag is required on the get action to achieve a lock? in my bdb implementation i used lockers to achieve this.
thanks,
tomer