Concurrent Worker Cancellation via Lock-Free Callback Tracking

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Implementing an efficient unified cancellation system for multi-processor machines that can handle many concurrent processes, ensuring fast registration and deregistration of callbacks, minimal memory usage, and safe concurrent access across disparate APIs.

Innovation Solution

A cancellation system with a manager object creating concurrent worker objects, using cancellation tokens and a lock-free callback tracking data structure to support concurrent calls, registration, and deregistration, while managing exceptions and synchronization contexts.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Adaptability or versatility

If a unified cancellation system is implemented for multi-processor machines, then concurrent access to cancellation management is enabled, but system complexity increases

Engineering Contradiction:
Improveconcurrent access supportVSAvoidsystem complexity
Core Design Contradiction:
Adaptability or versatilityVSDevice complexity

Solution Approach 1:

The cancellation system is segmented into distinct components: a cancellation object with a cancel method, a registration system with registered methods, and a callback tracking data structure. This segmentation allows each component to manage concurrent access independently, reducing overall system complexity while enabling multi-processor support.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The cancellation object serves multiple functions: it tracks cancellation requests, manages registered callbacks, and coordinates termination across concurrent worker objects. This multi-functionality reduces the need for separate specialized components, simplifying the system while maintaining concurrent access capabilities.

Inventive Principle:
Principle #6Universality (Multi-functionality)

2Productivity

If fast callback registration and deregistration are implemented, then operational efficiency improves, but memory usage increases

Engineering Contradiction:
Improvecallback management speedVSAvoidmemory usage
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The callback tracking data structure extracts and stores only the essential information needed for cancellation coordination, separating the cancellation state from the full callback implementation. This allows fast registration and deregistration by working with lightweight data structures rather than complete object graphs.

Inventive Principle:
Principle #2Taking out (Extraction)

Solution Approach 2:

The system dynamically allocates and discards callback registration entries as needed. When cancellation is requested, registered callbacks are executed and their registration entries are removed from memory. This selective memory management maintains fast operations while minimizing peak memory usage by discarding unnecessary callback tracking data.

Inventive Principle:
Principle #34Discarding and recovering

Data Source

PatentUS8327383B2Cancellation of concurrent worker objects
Publication Date: 2012.12.04 MICROSOFT TECHNOLOGY LICENSING LLC
  • US8327383B2 patent drawing
  • US8327383B2 patent drawing
  • US8327383B2 patent drawing

AI summary

A method of performing a cancellation of concurrent worker objects includes creating a plurality of concurrent worker objects with a manager object. At least one cancellation object is generated with the manager object. The at least one cancellation object includes a cancel method and a register method that support concurrent calls. A callback function is registered by calling the register method with one of the concurrent worker objects. A cancellation of the concurrent worker objects is requested by calling the cancel method with the manager object.