Task Wait Handle Batching for Parallel Processing Limits

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing systems are limited in waiting on a large number of tasks due to a fixed limit on wait handles, which is often exceeded in fine-grained task-based systems, leading to inefficiencies in parallel processing.

Innovation Solution

The method involves creating a continuation task to represent additional tasks and storing associated wait handles in an array, allowing for efficient waiting on any number of tasks through the use of WaitHandle.WaitAny and WaitHandle.WaitAll methods, with support for cancellation tokens to manage excess tasks.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Quantity of substance

If a fixed number of wait handles are used to manage tasks, then the system structure is simple and easy to implement, but the system cannot handle more than the limited number of tasks

Engineering Contradiction:
Improvenumber of tasksVSAvoidwait handle management complexity
Core Design Contradiction:
Quantity of substanceVSDevice complexity

Solution Approach 1:

The patent segments the large number of tasks into multiple groups, with each group managed by a separate wait handle. Instead of requiring one wait handle per task, multiple tasks are divided into batches where each batch is associated with a single wait handle, allowing the system to manage thousands of tasks with a limited number of wait handles.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent implements a nested structure where continuation tasks contain references to parent task groups. When a wait operation completes a group of tasks, it triggers a continuation task that automatically starts the next group. This nesting allows the system to handle an unlimited number of tasks through hierarchical task groups and continuation chains.

Inventive Principle:
Principle #7Nested doll (Nesting)

2Quantity of substance

If the number of wait handles is increased to support more tasks, then more tasks can be managed, but the system resource consumption increases

Engineering Contradiction:
Improvenumber of tasksVSAvoidsystem resource consumption
Core Design Contradiction:
Quantity of substanceVSLoss of energy

Solution Approach 1:

The patent merges multiple task wait operations into a single wait handle per task group. Instead of creating separate wait handles for each individual task, multiple tasks are combined into groups that share common wait handles, significantly reducing the total number of wait handles and associated system resources required to manage large numbers of tasks.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent uses periodic batch processing where tasks are executed in groups rather than individually. The system periodically waits for completion of a batch of tasks using a single wait handle, then triggers the next batch through continuation tasks. This periodic batching reduces resource consumption by reusing wait handles across multiple task groups instead of maintaining persistent wait handles for each task.

Inventive Principle:
Principle #19Periodic action

3Productivity

If fine-grained tasks are created to improve parallel processing efficiency, then better utilization of multiple processors is achieved, but the number of tasks exceeds the wait handle limit

Engineering Contradiction:
Improveparallel processing efficiencyVSAvoidnumber of tasks
Core Design Contradiction:
ProductivityVSQuantity of substance

Solution Approach 1:

The patent segments fine-grained tasks into hierarchical groups that can be managed efficiently. Individual fine-grained tasks maintain their parallel execution benefits, while parent task groups provide a manageable structure for wait operations. This segmentation allows the system to preserve the productivity benefits of fine-grained parallel tasks while overcoming the wait handle limitation through grouped management.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent creates a nested task hierarchy where fine-grained parallel tasks are contained within parent task groups, which are in turn contained within continuation task chains. This nesting allows fine-grained tasks to execute in parallel for high productivity, while the outer layers of the hierarchy provide efficient wait handle management by batching multiple fine-grained tasks into groups that can be waited upon collectively.

Inventive Principle:
Principle #7Nested doll (Nesting)

Data Source

PatentUS9229788B2Performing a wait operation to wait for one or more tasks to complete
Publication Date: 2016.01.05 MICROSOFT TECHNOLOGY LICENSING LLC
  • US9229788B2 patent drawing
  • US9229788B2 patent drawing
  • US9229788B2 patent drawing

AI summary

A method of performing a wait operation includes creating a first plurality of tasks and a continuation task. The continuation task represents a second plurality of tasks. The continuation task and each of the tasks in the first plurality have an associated wait handle. The wait handles for the first plurality of tasks and the continuation task are stored in an array. A wait operation is performed on the array, thereby waiting for at least one of the tasks in the first and second pluralities to complete.