wave4-jobhandle-combine-dependencies

Combine multiple upstream Unity DOTS JobHandles into a dependency barrier.

6|Updated Apr 2, 2026
One-click install
npx skills add https://github.com/dyCuong03/unity-agent-team --skill wave4-jobhandle-combine-dependencies
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: wave4-jobhandle-combine-dependencies
Source: https://github.com/dyCuong03/unity-agent-team/tree/main/.claude/skills/unity-dots/wave4-jobhandle-combine-dependencies
Command: npx skills add https://github.com/dyCuong03/unity-agent-team --skill wave4-jobhandle-combine-dependencies

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents race conditions in Unity DOTS when a downstream job depends on results from multiple independent upstream jobs by creating a correct fan-in dependency barrier.

Core Features & Use Cases

  • Fan-in barriers for parallel producers: Use JobHandle.CombineDependencies to ensure a downstream job waits for multiple upstream job handles before reading shared component data.
  • Converging job DAG pipelines: Perfect for multi-stage pipelines like spatial-hash → accumulate → steer where several parallel stages must finish before reduction.
  • Scales to many dependencies: Supports combining 2+ handles efficiently, including the NativeArray overload for more than 3 inputs.

Quick Start

Ask the AI how to replace a missing or sequential dependency chain with JobHandle.CombineDependencies by providing the upstream job handles and the downstream job assignment to state.Dependency.

Frequently Asked Questions about wave4-jobhandle-combine-dependencies

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I make a Unity DOTS job wait for multiple upstream jobs?

To make a Unity DOTS job wait for multiple upstream jobs, use JobHandle.CombineDependencies to create a fan-in barrier by passing all relevant upstream JobHandles and assigning the result to the final leaf handle for state.Dependency.

Why does my downstream Unity DOTS job have a race condition with parallel producers?

A race condition occurs in parallel Unity DOTS producers when downstream jobs read shared data without waiting for all upstream handles. Combine dependencies using JobHandle.CombineDependencies to synchronize the parallel jobs and prevent concurrent access issues.

How do I combine more than three JobHandles in a Unity DOTS pipeline?

To combine more than three JobHandles in a Unity DOTS pipeline, use the NativeArray overload of JobHandle.CombineDependencies. This efficiently scales the fan-in dependency barrier for converging job DAGs with many independent upstream dependencies.

When do I need JobHandle.CombineDependencies in a multi-stage simulation pipeline?

You need JobHandle.CombineDependencies in a multi-stage simulation pipeline when converging parallel stages, such as spatial-hash and accumulate, must finish before a final reduction step. This creates a correct dependency barrier without adding sequential stalls.

What is the best way to synchronize converging job DAGs without adding stalls?

The best way to synchronize converging job DAGs without adding stalls is replacing sequential chains with JobHandle.CombineDependencies. This creates a parallel fan-in barrier ensuring downstream jobs wait for all independent upstream results before consuming shared data.

Does JobHandle.CombineDependencies work for multi-producer data reads in Unity DOTS?

Yes, JobHandle.CombineDependencies works for multi-producer data reads in Unity DOTS. It ensures downstream jobs correctly wait for multiple independent upstream job results, preventing race conditions when converging parallel job DAGs access shared component data.