mdbx: отложенное освобождение имен связанных c dbi-хендлами и добавление опции MDBX_ENABLE_DBI_LOCKFREE.

Отложенное освобождение позволяет реализовать безопасное выполнение
fastpath/lockfree при повторном открытии из других потоков/транзакцйий
уже открытых subDB, что и происходит при активации добавленной опции
сборки `MDBX_ENABLE_DBI_LOCKFREE`.
This commit is contained in:
Леонид Юрьев (Leonid Yuriev)
2023-11-04 23:45:29 +03:00
parent 3622669a9f
commit 96504bf338
5 changed files with 173 additions and 40 deletions

View File

@@ -1348,6 +1348,11 @@ typedef struct MDBX_cursor_couple {
MDBX_xcursor inner;
} MDBX_cursor_couple;
struct mdbx_defer_free_item {
struct mdbx_defer_free_item *next;
uint64_t timestamp;
};
/* The database environment. */
struct MDBX_env {
/* ----------------------------------------------------- mostly static part */
@@ -1452,6 +1457,9 @@ struct MDBX_env {
bool me_prefault_write;
MDBX_env *me_lcklist_next;
#if MDBX_ENABLE_DBI_LOCKFREE
struct mdbx_defer_free_item *me_defer_free;
#endif /* MDBX_ENABLE_DBI_LOCKFREE */
/* --------------------------------------------------- mostly volatile part */