Thread-Local Statistics Object Allocation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Current database management systems face performance issues with registering highly-volatile statistics in multi-threaded applications due to synchronization overhead, which is prohibitively expensive and not suitable for high-performance environments.
Innovation Solution
A system and method that manages highly-volatile statistics without synchronization by using an associative registry with object headers containing version counters, allowing for efficient allocation and deallocation of statistics objects across cores, enabling linear scalability and fast performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Reliability
If synchronization (mutex) is used to manage statistics objects in multi-threaded applications, then thread safety is improved, but performance deteriorates due to prohibitively expensive synchronization overhead
Solution Approach 1:
The patent segments the statistics object management by introducing thread-local storage (TLS) slots that are uniquely associated with each thread. Instead of using a single global synchronized structure, each thread has its own statistics slot that can be accessed without synchronization. This segmentation eliminates the need for mutex operations while maintaining thread safety, as each thread operates on its own isolated statistics data.
2Ease of manufacture
If traditional data structures (linked list or tree) are used to store statistics objects, then ease of implementation is improved, but performance deteriorates due to synchronization requirements
Solution Approach 1:
The patent extracts the synchronization mechanism from the statistics object management system entirely. By using thread-local storage, the shared resource (global statistics structure) is removed and replaced with per-thread local copies. This extraction eliminates the synchronization overhead while maintaining the ability to manage statistics objects efficiently in multi-threaded environments.
3Speed
If lock-free allocation with global head is used, then allocation speed is improved, but performance deteriorates due to contention at allocation time
Solution Approach 1:
The patent applies local quality by making the allocation head local to each thread rather than global. Each thread has its own TLS slot that serves as its local allocation head, eliminating contention between threads during allocation. This localizes the resource that was previously shared globally, allowing each thread to allocate and access its statistics objects without interfering with other threads.
Data Source
AI summary
A system and method of managing highly-volatile statistics of a multi-threaded application environment. The statistics are represented by one or more statistics objects. Each statistics object of the one or more statistics objects is prefixed with an object header having a version counter with an initial version count of zero. Each statistics object is associated with a statistics class instance, each statistics class instance being associated with an associative registry that is configured to allocate smallest possible objects of a size equal to or greater than to that of the statistics objects, the registry segmenting the statistics objects according to a size class. Each allocated statistics object is constructed in the object frame after the object header. Then, the object header of each allocated statistics object is initialized. Once allocated, objects can be deallocated.

