Listener Manager Parallel Notify via Read-Only Array

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional listener managers using linked lists face performance issues due to potential race conditions and the need for synchronization, which restricts notify processes from running in parallel, especially in high-performance machines.

Innovation Solution

Implementing a read-only array managed by atomic assignments allows notify processes to operate without synchronization, enabling parallel execution while still synchronizing add and remove operations to prevent race conditions.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If synchronized blocks are used to prevent race conditions in linked list listener managers, then thread safety is improved, but parallel execution of notify processes is prevented

Engineering Contradiction:
Improvethread safetyVSAvoidparallel execution capability
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The listener management operations are segmented into two distinct paths: write operations (add/remove listeners) that require synchronization, and read operations (notify processes) that can execute in parallel without synchronization. This segmentation allows the system to maintain thread safety for modifications while enabling parallel notification processing.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The synchronization requirement is extracted from the notify operation, separating it from the read path. The patent removes the synchronized block from the notify method, allowing it to execute without acquiring locks, while maintaining synchronization only in the addListener and removeListener methods where race conditions actually occur.

Inventive Principle:
Principle #2Taking out (Extraction)

2Speed

If linked list data structure is used for fast add and remove operations, then operation speed is improved, but race conditions occur that require synchronization

Engineering Contradiction:
Improveadd and remove operation speedVSAvoidrace condition prevention
Core Design Contradiction:
SpeedVSReliability

Solution Approach 1:

The patent creates a copy of the listener collection for notify operations, allowing the read path to operate on a static snapshot without requiring synchronization with the write path. This copying mechanism eliminates the need for synchronized blocks in notify while preserving the fast add/remove operations of the linked list structure.

Inventive Principle:
Principle #26Copying

3Quantity of substance

If arrays are used instead of linked lists, then memory efficiency is improved, but add and remove operations become slow due to copying and resizing

Engineering Contradiction:
Improvememory usageVSAvoidadd and remove operation speed
Core Design Contradiction:
Quantity of substanceVSSpeed

Solution Approach 1:

The patent applies different data structure characteristics to different operational needs: the linked list structure is maintained for efficient add/remove operations, while arrays or other collection types can be used for the notify operation's iteration through listeners. Each part of the system uses the data structure property that is optimal for its specific function.

Inventive Principle:
Principle #3Local quality

Data Source

PatentUS8584143B2Collection access in a parallel environment
Publication Date: 2013.11.12 ORACLE INT CORP
  • US8584143B2 patent drawing
  • US8584143B2 patent drawing
  • US8584143B2 patent drawing

AI summary

Systems, methods, and other embodiments associated with collection access are described. One example system includes a data store to store a set of listener object identifiers. A listener object identifier identifies a member of a set (or collection) of listener objects. A Listener object initiates an action in response to an occurrence of an event associated with a member of a set of external logics. A member of the set of external logics invokes a notify process to trigger actions. The example system may also include storing the listener object identifiers in an array to allow instances of the notify process to operate in parallel.