Tagged References for Thread-Local Data Identification

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional memory management schemes for multithreaded applications face inefficiencies in identifying thread-local data, as they often rely on address-range checks or loading bits/fields to determine thread locality, which can be costly and restrict the allocation of thread-local objects to specific memory regions.

Innovation Solution

The implementation of a tagged reference mechanism, where one or more bits in the object reference are set to indicate thread-local status, allowing for inexpensive read- and write-barrier checks and enabling thread-local objects to be allocated anywhere in memory without partitioning the heap into thread-local and global regions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If address-range checks are used to identify thread-local data, then thread locality can be determined, but the cost of identification increases and allocation is restricted to specific memory regions

Engineering Contradiction:
Improvethread locality identification accuracyVSAvoididentification cost and allocation flexibility
Core Design Contradiction:
Measurement precisionVSProductivity

Solution Approach 1:

The patent embeds thread-locality information directly within the object reference structure itself, nesting the identification marker inside the reference. This eliminates the need for separate address-range checks while maintaining accurate thread locality identification, as the tag is inherently part of the reference.

Inventive Principle:
Principle #7Nested doll (Nesting)

Solution Approach 2:

The patent applies different qualities to different parts of the reference structure by using specific bits (e.g., the lowest-order bit) to encode thread-locality information. This allows the reference to simultaneously serve as both a memory address and a thread-locality indicator, improving identification efficiency without restricting allocation flexibility.

Inventive Principle:
Principle #3Local quality

2Measurement precision

If bits or fields are loaded to determine thread locality, then thread-local data can be identified, but the operation becomes costly

Engineering Contradiction:
Improvethread locality determination accuracyVSAvoiddetermination time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The thread-locality bit is nested within the object reference structure, allowing the determination of thread locality to occur as a natural byproduct of reference handling rather than requiring separate loading operations. The bit is already present in the reference value, eliminating additional memory access overhead.

Inventive Principle:
Principle #7Nested doll (Nesting)

Solution Approach 2:

The object reference itself carries the thread-locality information, making the reference self-descriptive. This eliminates the need for separate determination operations, as the reference structure provides all necessary information about the object's thread-locality status directly within its own bits.

Inventive Principle:
Principle #25Self-service

3Ease of manufacture

If heap is partitioned into thread-local and global regions, then thread-local objects can be identified by address range, but allocation flexibility is reduced

Engineering Contradiction:
Improvethread-local object identification simplicityVSAvoidmemory allocation flexibility
Core Design Contradiction:
Ease of manufactureVSAdaptability or versatility

Solution Approach 1:

Instead of partitioning the heap into distinct regions, the patent applies a local quality marker (the thread-local bit) to individual object references. This allows any memory location to potentially hold thread-local objects, maintaining full allocation flexibility while still enabling simple identification through the bit check.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent segments the reference space rather than the physical heap by using specific bits in the reference to encode thread-locality. This virtual segmentation allows logical separation of thread-local and global objects without physical partitioning, maintaining allocation flexibility while enabling straightforward identification.

Inventive Principle:
Principle #1Segmentation

Data Source

PatentUS7954100B1Tagged references for thread-local data
Publication Date: 2011.05.31 ORACLE AMERICAN INC
  • US7954100B1 patent drawing
  • US7954100B1 patent drawing
  • US7954100B1 patent drawing

AI summary

Method and apparatus for tagged references for identifying thread-local data in multithreaded applications. Embodiments may provide a dynamic mechanism that identifies thread-local objects by “tagging” references to the objects. In embodiments, in an application, if an object is to be allocated as a thread-local object, one or more bits of the object reference may be “tagged” to indicate that the object is a thread-local object. In one embodiment, the lowest-order bit of the object reference may be set to indicate that the object is a thread-local object. In embodiments, thread locality of an object may be determined by testing the reference itself rather than loading a bit or field from the referenced object or by checking address ranges. Further, embodiments do not rely on address ranges to identify objects as thread-local, and so the allocation of thread-local objects may not be restricted to thread-local heaps.