# التنفيذ المتوازي

Canonical URL: https://developers.iagenify.com/ar/sdk/agent/parallelism/
Language: ar

كل واحد منها هو قراءة أو عنصر فرعي. أي شيء يمكن أن يسأل المستخدم تشغيل واحد في كل مرة.

Status: read and task only · all-or-nothing per turn · subagents fan out

The rule is deliberately blunt: the engine looks at the [category](/ar/sdk/agent/permissions/categories) of every call in the turn, and runs them in parallel only if **all** of them are `read` or `task`. One write in the batch and the whole turn goes sequential.

```javascript
// Parallel: three reads in one turn
read { path: "a.md" }   glob { pattern: "**/*.ts" }   grep { pattern: "TODO" }

// Sequential: the write makes the whole turn sequential
read { path: "a.md" }   write { path: "b.md", content: "…" }
```

## لماذا هو كل أو لا شيء {#why}

> **لا يمكن تقديم طلب إذن**
>
> وإذا كان هناك نداءان يحتاجان إلى الموافقة في آن واحد، فإن المستخدم سيواجه دافعين للقيام بأعمال غير محددة الترتيب - والموافقة على أحدهما يعني الموافقة على حالة تتغير فيها الأخرى في آن واحد.

كما أنها تبقي قصة الفشل بسيطة: في دور متتابع، النداء الذي يفشل تتبعه نداءات يمكن أن ترى فشله.

## "الوكلاء" حيث يدفع {#subagents}

`task` في المجموعة المتوازية، لذا هناك عدة عوامل فرعية مطلوبة في نفس الدور والتي يتم تنفيذها في وقت واحد، كل منها مع سياقه الخاص. هذا هو المكان الوحيد حيث يصبح العمل الطويل أقصر بشكل ملموس.

```javascript
// The model asks for three in one turn — all three run at once
task { agent: "explore", description: "Map the data layer" }
task { agent: "explore", description: "Map the API routes" }
task { agent: "explore", description: "Find every TODO older than a year" }
```

دورهم يُضاف إلى دور الوالد `usage` كما يحدث، لذا فإن المشاركة [الميزانية](/ar/sdk/agent/budget) كل ما عليها كلها قضم معاً أحداثها تصل إلى `onEvent` (أ) تشمل ما يلي: `parentId`وتعرف هوياتهم مسبقاً مع المهمة

## A a تسلسلي مراجعة تفقّد توقّف بين المكالمات {#stopped}

كل مكالمة في دفعة متتابعة يسبقها فحص التوقف، لذلك `stop()` في الوقت نفسه. دفعة موازية في حالة طيران ونهاية.

## ويُطلب من هذا النموذج دفع {#encourage}

الـ [نظام نظام نظام مُقِس](/ar/sdk/agent/system-prompt) الأسماء الموجودة `read { paths }`, `bash { commands }`كل نداء من أدواته يكلف بدوره كل دورة، لذا فإن الدفع هو أكبر أداة وحيدة على أي تكاليف تشغيل.

- [%](/ar/sdk/agent/tools/task): أداة الـ.
- [فئات](/ar/sdk/agent/permissions/categories): ما الذي يجعل الدعوة قراءة.
- [حلقة التنفيذ](/ar/sdk/agent/loop): ما هي الخطوة الواحدة، وما الذي ينهيها.

```python
# The Python engine runs the calls of one turn in order, one after the other:
#   read {"path": "a.md"}   glob {"pattern": "**/*.ts"}   grep {"pattern": "TODO"}

# A write in the same turn simply runs at its place in that order
#   read {"path": "a.md"}   write {"path": "b.md", "content": "…"}
```

```python
# The model may ask for several subagents in one turn; Python runs them one after the other
#   task {"agent": "explore", "description": "Map the data layer"}
#   task {"agent": "explore", "description": "Map the API routes"}
#   task {"agent": "explore", "description": "Find every TODO older than a year"}
```
