Shared Memory Hash Table Lookaside Buffer Versioning
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
In data networking, readers may read invalid data when attempting to access shared memory hash tables being concurrently updated by a writer, leading to inconsistencies and invalid data usage.
Innovation Solution
Implementing a lookaside buffer to temporarily store bucket data during updates, with version management to indicate modification status, allowing readers to access valid data without locks or memory allocation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If readers read data from shared memory hash table concurrently with writer updates, then data access speed is improved, but data validity and consistency deteriorate
Solution Approach 1:
The patent segments the hash table into multiple buckets, allowing readers to access different buckets concurrently with writer updates on other buckets. This segmentation enables parallel access while maintaining data consistency within each bucket, resolving the contradiction between speed and reliability.
Solution Approach 2:
The patent introduces version numbers as an intermediary mechanism to mediate between readers and writers. Version numbers allow readers to detect concurrent modifications and retry reads, ensuring data validity while maintaining high access speed. The version number acts as a mediator that coordinates read-write operations without blocking.
2Reliability
If locks are used to prevent readers from accessing invalid data, then data consistency is improved, but access speed and productivity deteriorate
Solution Approach 1:
The patent implements self-service through version number checking, where readers autonomously detect and handle concurrent modifications without external locking. Readers check version numbers and retry reads if modifications are detected, eliminating the need for locks while maintaining data consistency. This self-service mechanism preserves high access speed while ensuring reliability.
Solution Approach 2:
The patent replaces the mechanical locking system with a software-based version number checking mechanism. Instead of using locks to prevent concurrent access, the system uses version numbers to detect and handle conflicts, substituting a blocking mechanical approach with a non-blocking software solution that maintains both consistency and speed.
3Reliability
If memory allocation is used to create separate copies for readers, then data validity is improved, but memory usage and device complexity deteriorate
Solution Approach 1:
The patent uses selective copying only when necessary - specifically when version number changes indicate concurrent modifications. Readers copy data from the hash table only when needed, rather than maintaining permanent separate copies. This approach ensures data validity while minimizing memory usage by copying only when updates occur.
Solution Approach 2:
The patent changes the state parameter of the hash table entries by incrementing version numbers to indicate modification status. This parameter change allows the system to track updates without creating separate data structures, maintaining data validity through version tracking rather than through memory duplication.
Data Source
Figure 1
Figure 2
Figure 3
AI summary
A method and apparatus of a device that reads and writes data using a shared memory hash table and a lookaside buffer is described. In an exemplary embodiment, a device locates a bucket for the data in a shared memory hash table, where a writer updates the shared memory hash table and a reader that is one of a plurality of readers reads from the shared memory hash table. The device further retrieves an initial value of a version of the bucket. If the initial value of the version is odd, the device copies the data from a lookaside buffer of the writer to a local buffer for the reader, wherein the lookaside buffer stores a copy of the data while the bucket is being modified.