Global Counter Implementation Using Local Caching and Delta Values
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data storage systems face challenges in efficiently managing global data items shared among multiple processing cores, where updates to global data items often require exclusive access, leading to bottlenecks and reduced performance due to the need for synchronization mechanisms.
Innovation Solution
Implementing a double buffering technique within each processing core's private cache, using two sets of buffers for counters and delta values, and toggle values to alternate between reading and updating, allowing concurrent access and modification without blocking other reads or writes.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If exclusive access mechanisms are used to update global data items, then data consistency is maintained, but system performance and throughput are reduced due to synchronization bottlenecks
Solution Approach 1:
The global counter is segmented into two independent parts: a local counter cached in each processing core's private cache and a global delta value stored in global memory. Each processing core can independently update its local counter without acquiring locks, while only the delta value requires synchronization. This segmentation allows concurrent updates while maintaining data consistency through periodic synchronization of the delta component.
Solution Approach 2:
A delta value acts as an intermediary between the local counters and the global counter. Instead of directly synchronizing all local counters with global memory, the system uses delta values to represent differences that need to be propagated. This intermediary approach reduces the frequency and scope of synchronization operations, improving throughput while maintaining consistency.
2Reliability
If synchronization mechanisms are implemented for global counter updates, then data integrity is ensured, but access time and operation speed are reduced
Solution Approach 1:
Each processing core pre-loads the global counter value into its private cache as a local counter before performing updates. This preliminary action allows the core to perform multiple local updates without accessing global memory, significantly improving update speed. The cached value is periodically refreshed to maintain data integrity without requiring synchronization for each update operation.
Solution Approach 2:
The system performs periodic synchronization of the delta value from global memory to local caches, rather than synchronizing after every update. This periodic approach maintains data integrity by ensuring that local counters are eventually consistent with the global counter, while dramatically improving update speed by eliminating frequent synchronization overhead.
3Speed
If local caching is used for global counters, then read performance is improved, but maintaining consistency between local and global values increases complexity
Solution Approach 1:
The invention extracts only the changing portion of the counter state (the delta value) from the global memory and stores it separately. Instead of caching the entire global counter and managing full synchronization, the system extracts and caches only the differences that need to be propagated to local counters. This extraction approach simplifies the consistency mechanism while maintaining read performance.
Solution Approach 2:
The system changes the parameter representation from storing absolute counter values to storing delta (difference) values. This parameter transformation simplifies the consistency model because deltas are additive and can be independently computed and propagated. The local counter is simply the sum of the cached base value and the delta, making consistency management more straightforward.
Data Source
AI summary
Providing global values may include configuring a global memory to include a global counter and configuring processing cores to have private caches each including two sets of buffers, an update toggle and a read toggle. A processing core having a first private cache may perform processing to read a current value for the global counter including determining the current value of the global counter as a mathematical sum of a local counter value and a local delta value from one of the two sets of buffers of the first private cache identified by the read toggle. The processing core may perform processing to modify the global counter by a first amount by updating the local delta value from a specified one of the two set of buffers of the first private cache identified by the update toggle.


