parallel-execution
Parallel Execution
Execute multiple independent tasks simultaneously to maximize throughput and minimize total execution time.
When to Use
- Multiple independent tasks (no dependencies)
- Tasks benefit from concurrent execution
- Maximizing throughput is priority
- Available agents for parallel work
- Results can be aggregated after completion
Core Concepts
Independence
Tasks are independent when:
- ✓ No data dependencies
- ✓ No resource conflicts
- ✓ No ordering requirements
- ✓ Failures are isolated
Concurrency
Critical: Use single message with multiple Task tool calls:
[Task tool] → Agent A
[Task tool] → Agent B
[Task tool] → Agent C
All start simultaneously.
Execution Patterns
| Pattern | Description | Example |
|---|---|---|
| Homogeneous | Same agent, different inputs | Test 3 modules |
| Heterogeneous | Different agents, related task | Review + Test + Profile |
| Parallel + Convergence | Parallel → Synthesize | Profile + Analyze → Root cause |
Synchronization Strategies
- Wait for All: Proceed when ALL complete
- Wait for Any: Early termination on first success
- Threshold: Proceed when N of M complete
Performance
Sequential: T1 + T2 + T3
Parallel: max(T1, T2, T3)
Speedup = Sequential / Parallel
Example: 3 tasks (10+15+8 min) → Parallel (15 min) = 2.2x faster
Best Practices
✓ Verify independence before parallelizing ✓ Use single message with multiple Task calls ✓ Balance workload across agents ✓ Handle failures gracefully
✗ Don't parallelize dependent tasks ✗ Don't send sequential messages
More from d-o-hub/rust-self-learning-memory
loop-agent
Execute workflow agents iteratively for refinement and progressive improvement until quality criteria are met. Use when tasks require repetitive refinement, multi-iteration improvements, progressive optimization, or feedback loops until convergence.
51web-search-researcher
Research topics using web search and content fetching to find accurate, current information. Use when you need modern information, official documentation, best practices, technical solutions, or comparisons beyond your training data.
46perplexity-researcher-reasoning-pro
Highest level of research and reasoning capabilities for complex decision-making with significant consequences, strategic planning, technical architecture decisions, multi-stakeholder problems, or high-complexity troubleshooting requiring expert-level judgment and sophisticated reasoning chains. Prioritizes actively maintained repositories and validates website sources for 2025 relevance.
44context-retrieval
Retrieve relevant episodic context from memory for informed decision-making. Use when you need past episodes, patterns, or solutions to similar tasks.
44rust-code-quality
Perform comprehensive Rust code quality reviews against best practices for async Rust, error handling, testing, and project structure
43codebase-analyzer
Analyze implementation details, trace data flow, explain technical workings, locate files, and consolidate codebases. Use when you need to understand HOW code works, find file locations, or assess technical debt.
40