Episode 917 minutes

Native Concurrency: async/await, Task<T> & Parallel Tasks

Write race-free async/await parallel code backed by a bounded OS thread pool and isolated per-task arenas.

Lesson Video Coming Soon

This episode's HD lesson video will appear directly in this player once published. Meanwhile, run and modify the live HADID v0.13 code lab right below!

Learning Objectives

  • Declare async fn / asenkron fonksiyon returning Task<T> / Gorev<T>
  • Fan out tasks in parallel and join via await / await_all
  • Compose async Tasks with Result<T, E> via await task?

Architecture Summary

Each async fn call in HADID v0.13 spawns immediately onto a bounded OS worker pool with its own isolated arena and returns a Task<T> handle. await t1? joins the task and unwraps its Result safely.

Live HADID v0.13 Code Lab

LIVE COMPILER

Episode 9 · Interactive Lab

Live Native C17 · v0.13.0
main.had

Run with Ctrl / ⌘ + Enter

Executes on the real HADID v0.13.0 Linux compiler inside a network-isolated container (async/await, closures, Generic fn<T> + where, Query<T>, loop-fused lambdas, html_render, crypto, SQLite :memory:, and full EN/TR syntax). Use the local `hadid` CLI for disk SQLite, live WebSocket/HTTP servers, and native AOT binaries.

Sign in with Digital HAT ID to earn Code Lab (+25 XP), Quiz (+50 XP), badges, and certificates.Sign In

Knowledge Check

1. When does an async fn begin executing in HADID v0.13?