Repository navigation
Lock-free TransactionChain + IndexRef & bulk enumerate (#145) - #159
Merged
Merged
Conversation
Singly-linked lock-free chain (CAS PushHead/Remove), read-onlytransactions, dispose race fix. IndexRef readonly struct with layout-version staleness detection. Zero-copy MVCC bulk enumerate over PK and secondary indexes via ref struct enumerators with ReadOnlySpan into epoch-protected page memory.
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CreateTransaction: Replaced exclusiveAccessControllock with CAS-based lock-free push on the transaction chain head. The hot path (Create) no longer serializes with anything — onlyRemove(cold path) retains the exclusive lock.Previouspointers, replacedTail.Previous?.TSNlookups with a scan-basedComputeNextMinTSN()helper under shared lock.ComponentTable.DatabaseEngine.EnumerateEntitiesAPI for efficient bulk entity enumeration.Queue<Transaction>toConcurrentQueue<Transaction>for thread-safe recycling without locks.Changed Files (14 files, +1769 / -65)
TransactionChain.cs— Core lock-free refactor (CAS PushHead, singly-linked, ConcurrentQueue pool)Transaction.cs— Drop Previous field, update 3 NextMinTSN call sites, expanded transaction logicIndexRef.cs— New lightweight index reference structComponentTable.cs/DatabaseEngine.cs/DatabaseEngineExtensions.cs— Bulk enumerate + IndexRef supportCacheLinePadded.cs— New cache-line padding utilityPagedMMF.cs— Minor storage adjustmentsThrowHelper.cs— New error helpersTransactionChainTests.cs,BulkEnumerateTests.cs,IndexRefTests.cs(1122 lines of new tests)Test Plan
Closes #145