Lock Allocation Proximity for Shared Data Synchronization

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

In shared memory processes, existing lock allocation and resolution techniques are error-prone and inefficient, requiring manual identification and hash tables to associate locks with variables, leading to potential deadlocks and atomicity violations due to incorrect lock selection or timing.

Innovation Solution

Allocating locks proximate to the shared resources they protect, allowing lock locations to be inferred from the memory addresses of the variables, eliminating the need for hash tables and manual identification, and enabling efficient lock resolution through relative offsets.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If locks are allocated separately from shared variables with manual identification, then lock-variable relationship tracking is flexible, but programmer errors increase and lock resolution efficiency decreases

Engineering Contradiction:
Improvelock selection correctnessVSAvoidlock acquisition time
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent merges the lock structure with the shared variable by allocating the lock proximate to the variable it protects in the same data structure. This combination eliminates the need for separate lock allocation and manual tracking, ensuring that the correct lock is always associated with the correct variable while enabling direct computation of the lock address from the variable address, thus improving both reliability and productivity.

Inventive Principle:
Principle #5Merging (Combining)

2Adaptability or versatility

If hash tables are used to resolve lock-variable relationships, then lock association is flexible, but lock resolution time increases significantly

Engineering Contradiction:
Improvelock allocation flexibilityVSAvoidlock resolution time
Core Design Contradiction:
Adaptability or versatilityVSLoss of time

Solution Approach 1:

The patent extracts the lock resolution process from the hash table lookup mechanism. By allocating locks proximate to their protected variables, the system computes the lock address directly through address arithmetic rather than performing hash table lookups. This extraction eliminates the time-consuming hash computation and table traversal while maintaining the flexibility of dynamic lock allocation.

Inventive Principle:
Principle #2Taking out (Extraction)

3Manufacturing precision

If locks are predefined with compile-time symbols, then type safety is improved, but adaptability to dynamic lock allocation decreases

Engineering Contradiction:
Improvecompile-time lock correctnessVSAvoiddynamic lock allocation capability
Core Design Contradiction:
Manufacturing precisionVSAdaptability or versatility

Solution Approach 1:

The patent introduces dynamics into lock allocation by allowing locks to be allocated at runtime proximate to shared variables rather than being predefined at compile time. The system maintains correctness by computing the lock address dynamically based on the variable address and a fixed offset, enabling flexible lock allocation while preserving the type safety and correctness guarantees of compile-time approaches.

Inventive Principle:
Principle #15Dynamics

4Device complexity

If locks and variables are stored in separate memory locations, then memory organization is simple, but cache performance deteriorates due to separate access

Engineering Contradiction:
Improvememory organization simplicityVSAvoidcache access efficiency
Core Design Contradiction:
Device complexityVSUse of energy by moving object

Solution Approach 1:

The patent merges the lock and variable into the same memory location by allocating the lock proximate to the variable it protects. This merging ensures that both the variable and its associated lock reside in the same cache line, enabling the processor to fetch both items in a single cache access. This eliminates the need for separate memory accesses, improving cache efficiency and reducing energy consumption while maintaining simple memory organization.

Inventive Principle:
Principle #5Merging (Combining)

Data Source

PatentUS8868849B2Coupled lock allocation and lookup for shared data synchronization in symmetric multithreading environments
Publication Date: 2014.10.21 SAMSUNG ELECTRONICS CO LTD
  • US8868849B2 patent drawing
  • US8868849B2 patent drawing
  • US8868849B2 patent drawing

AI summary

In a shared memory process different threads may attempt to access a shared data variable in a shared memory. Locks are provided to synchronize access to shared data variables. Each lock is allocated to have a location in the shared memory relative to the instance of shared data that the lock protects. A lock may be allocated to be adjacent to the data that it protects. Lock resolution is facilitated because the memory location of a lock can be determined from an offset with respect to the data variable that is being protected by the lock.