Programming Search⌘K

Conceptcore

Async/await

Also called async functions, async and await, coroutines with await.

An async function can pause at each await until a result is ready, and a scheduler runs other tasks in the meantime. Code that waits for many things reads like sequential code.

Applies to
core-languages

Idea

A program that talks to a network or a disk spends most of its time in waits. One thread per wait is costly when there are thousands of waits. Callbacks avoid the threads, but they break the code into many small functions. Async/await keeps one function per job. An async function runs until it reaches an await. There it gives control back to a scheduler, which runs other tasks. When the awaited result is ready, the scheduler resumes the function at the same place, with its local variables intact.

In Python, asyncio.gather runs two loads at the same time on one thread. The slow load starts first, but the fast load ends first. The total time is about 200 ms, not 300 ms.4

import asyncio


async def load(name, delay):
    print("start", name)
    await asyncio.sleep(delay)
    print("end", name)
    return name


async def main():
    results = await asyncio.gather(load("slow", 0.2), load("fast", 0.1))
    print(results)


asyncio.run(main())
Output
start slow
start fast
end fast
end slow
['slow', 'fast']

async def makes a coroutine function. await is allowed only inside it.23 asyncio.run starts the event loop and runs main to its end.

How it works

The compiler turns an async function into a state machine. Each await is a suspension point. The state records which suspension point the function reached and the local variables that are still needed after it. A call of the async function makes this state and returns an object that stands for the result that will come: a coroutine in Python, a Promise in JavaScript, a Task in C#, a Future in Rust. Python coroutines use the generator machinery of the interpreter for this.1

A scheduler, usually an event loop, drives the state machines. It keeps a queue of tasks that can run, and a list of things that tasks wait for: timers, sockets, and other tasks. One turn of the loop works as follows.

  1. Take a task that can run, and resume it.
  2. The task runs until it awaits something that is not ready. It registers itself as the continuation of that thing and returns to the loop.
  3. When no task can run, wait for the next timer or for the operating system to report a ready socket.
  4. Mark the tasks that wait on the ready things as runnable, and go to step 1.

The timeline of the example in Idea:

time    event loop                              task slow            task fast
0 ms    resume slow                             print "start slow"
0 ms                                            await sleep(0.2)
0 ms    resume fast                                                  print "start fast"
0 ms                                                                 await sleep(0.1)
0 ms    nothing can run: wait for a timer
100 ms  timer of fast fires, resume fast                             print "end fast", return
200 ms  timer of slow fires, resume slow        print "end slow", return
200 ms  both results ready, resume main         main prints the list

The scheduling is cooperative. A task gives up control only at an await. With one thread, two tasks never run at the same instant, so the code between two awaits needs no lock. The other side of the same rule: a task that computes for a long time, or that calls a blocking function, stops every other task (see Pitfalls).

Languages differ in when the body of an async function starts. In JavaScript, the call runs the body at once, up to the first await. The rest runs later, from the job queue, even when the awaited value is already there.8910

async function load() {
  console.log("1. load starts");
  await null;
  console.log("3. load resumes");
}

load();
console.log("2. caller continues");
Output
1. load starts
2. caller continues
3. load resumes
Language A call of the async function gives The body starts The scheduler
Python a coroutine object when it is awaited or wrapped in a task4 the asyncio event loop of the standard library
JavaScript, TypeScript a Promise at once, up to the first await8 the host's event loop (browser, Node.js, Deno) and the job queue
C# a Task, Task<T> or ValueTask<T> at once, up to the first await of an incomplete task11 the thread pool, or the synchronization context of the caller
Rust a value that implements Future when an executor first polls it15 none in the standard library; an executor from a library
C++ the coroutine type that the program or a library defines as the promise type says, with initial_suspend16 none in C++23; the C++26 draft adds std::execution::task18
Kotlin the result itself, to a caller that is also suspend at once, in the coroutine of the caller the kotlinx.coroutines library; the standard library has only the primitives1920

In languages

LanguageVerdictNote
PythonNative
C++Native
JavaAbsentThe language has no async functions and no await. Alternative: Virtual threads (JEP 444) with blocking code, or CompletableFuture with callbacks.
CAbsentThe standard has no coroutines and no event loop. Alternative: Callbacks with an event library, or one thread for each blocking job.
C#Native
JavaScriptNative
TypeScriptNative
GoAbsentThe language has no async functions and no await. Alternative: Goroutines and channels; the runtime multiplexes goroutines onto threads.
RustNative
KotlinNative
SQLDoes not applyA query does not control its own scheduling.
BashAbsentA function cannot suspend and resume. Alternative: Background processes with & and wait.
PowerShellAbsentA script block cannot suspend and resume. Alternative: Thread jobs (Start-ThreadJob) and ForEach-Object -Parallel.
HTMLDoes not applyMarkup has no control flow.
CSSDoes not applyStyle rules have no control flow.
Regular expressionsDoes not applyA pattern has no control flow over time.

The example files show the same two loads in each language where async/await exists. The Rust, C++ and Kotlin examples use only the standard library, so each one contains a small scheduler. Real programs use a library executor or kotlinx.coroutines instead.

Language Verdict Form
Python native async def, await, the asyncio package
JavaScript native async function, await, Promise
TypeScript native as JavaScript, with the type Promise<T>
Java absent virtual threads, or CompletableFuture with callbacks
C absent callbacks with an event library, or threads
C++ native co_await in a coroutine; the task type comes from a library
C# native async, await, Task
Go absent goroutines and channels
Rust native async fn, .await, the Future trait; the executor comes from a library
Kotlin native suspend fun; async and await are library functions of kotlinx.coroutines
PowerShell absent thread jobs and ForEach-Object -Parallel
Bash absent background processes with & and wait
SQL n/a a query does not control its own scheduling
Regex n/a a pattern has no control flow over time
HTML/CSS n/a markup and style have no control flow

Java has no async or await. Virtual threads make a blocking call cheap: when a virtual thread blocks on I/O, the runtime unmounts it and runs another virtual thread on the same carrier thread.21 Plain blocking code then scales to many waits, which is the goal of async/await. CompletableFuture gives a callback style for code that wants futures.

Go has no async or await either. The go statement starts a function call in a separate goroutine.22 The runtime multiplexes goroutines onto a set of operating system threads. When a goroutine blocks in a system call, the runtime moves the other goroutines to another thread, so they keep running.33 Go code is therefore written in the blocking style.

C has no coroutines in the standard. Programs use callbacks with an event library, or one thread for each blocking job. PowerShell and Bash run work in parallel with jobs and background processes, but they have no suspension inside a function.

PythonGitHub
import asyncio


async def load(name, delay):
    print("start", name)
    await asyncio.sleep(delay)
    print("end", name)
    return name


async def main():
    results = await asyncio.gather(load("slow", 0.2), load("fast", 0.1))
    print(results)


asyncio.run(main())
Output
start slow
start fast
end fast
end slow
['slow', 'fast']
  • Verdict: native. async def makes a coroutine function, and await suspends it.
  • The asyncio package of the standard library gives the event loop, tasks, timers and network streams. asyncio.run starts the loop and runs one coroutine to its end.
  • Calling a coroutine function does not run its body. The coroutine runs when it is awaited, or when asyncio.create_task or asyncio.gather schedules it.
  • asyncio.TaskGroup starts a group of tasks and waits for all of them. It cancels the others when one of them fails.
#include <chrono>
#include <coroutine>
#include <exception>
#include <functional>
#include <print>
#include <queue>
#include <string>
#include <thread>
#include <vector>

using Clock = std::chrono::steady_clock;

// A coroutine type that starts at once and frees its frame at the end.
struct Detached {
    struct promise_type {
        Detached get_return_object() { return {}; }
        std::suspend_never initial_suspend() { return {}; }
        std::suspend_never final_suspend() noexcept { return {}; }
        void return_void() {}
        void unhandled_exception() { std::terminate(); }
    };
};

// The event loop: suspended coroutines that wait for a time, earliest first.
struct Timer {
    Clock::time_point due;
    std::coroutine_handle<> handle;
    bool operator>(const Timer &other) const { return due > other.due; }
};
std::priority_queue<Timer, std::vector<Timer>, std::greater<>> timers;

// co_await Sleep{...} suspends the coroutine and adds a timer.
struct Sleep {
    std::chrono::milliseconds delay;
    bool await_ready() const { return false; }
    void await_suspend(std::coroutine_handle<> h) const {
        timers.push({Clock::now() + delay, h});
    }
    void await_resume() const {}
};

Detached load(std::string name, int ms, std::string &result) {
    std::println("start {}", name);
    co_await Sleep{std::chrono::milliseconds(ms)};
    std::println("end {}", name);
    result = name;
}

int main() {
    std::vector<std::string> results(2);
    load("slow", 200, results[0]);
    load("fast", 100, results[1]);
    while (!timers.empty()) {
        Timer next = timers.top();
        timers.pop();
        std::this_thread::sleep_until(next.due);
        next.handle.resume();
    }
    std::println("{}, {}", results[0], results[1]);
}
Output
start slow
start fast
end fast
end slow
slow, fast
  • Verdict: native. A function that contains co_await, co_yield or co_return is a coroutine.
  • The language gives the mechanism, not a task type or a scheduler. The return type names a promise type, and the promise type says whether the coroutine starts at once (initial_suspend) and what happens at the end.
  • This example defines the coroutine type Detached, the awaitable Sleep and a timer queue as the event loop. Programs usually take these from a library. The C++26 working draft adds std::execution::task.
  • Detached starts at once and frees its state at the end. The results go into strings that live in main, which outlive the coroutines.
async Task<string> Load(string name, int ms)
{
    Console.WriteLine($"start {name}");
    await Task.Delay(ms);
    Console.WriteLine($"end {name}");
    return name;
}

string[] results = await Task.WhenAll(Load("slow", 200), Load("fast", 100));
Console.WriteLine(string.Join(", ", results));
Output
start slow
start fast
end fast
end slow
slow, fast
  • Verdict: native. An async method returns Task, Task<T> or ValueTask<T>, and await suspends it until the awaited task completes.
  • The method runs at once, up to the first await of a task that is not complete.
  • Task.WhenAll waits for all the tasks. The continuations run on thread pool threads in a console program, so the code between two awaits can run on different threads.
  • A top-level await in the main file makes the generated Main method async.
JavaScriptGitHub
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

async function load(name, ms) {
  console.log("start", name);
  await sleep(ms);
  console.log("end", name);
  return name;
}

async function main() {
  const results = await Promise.all([load("slow", 200), load("fast", 100)]);
  console.log(results.join(", "));
}

main();
Output
start slow
start fast
end fast
end slow
slow, fast
  • Verdict: native. An async function returns a Promise, and await suspends the function until a promise settles.
  • The body runs at once, up to the first await. The rest runs later, from the job queue of the host.
  • Promise.all waits for all the promises and rejects as soon as one of them rejects. Promise.allSettled waits for all of them in every case.
  • The browser, Node.js, Deno and Bun each give the event loop. The language gives only the job queue for promise reactions.
TypeScriptGitHub
const sleep = (ms: number): Promise<void> =>
  new Promise((resolve) => setTimeout(resolve, ms));

async function load(name: string, ms: number): Promise<string> {
  console.log("start", name);
  await sleep(ms);
  console.log("end", name);
  return name;
}

async function main(): Promise<void> {
  const results = await Promise.all([load("slow", 200), load("fast", 100)]);
  console.log(results.join(", "));
}

main();
Output
start slow
start fast
end fast
end slow
slow, fast
  • Verdict: native. TypeScript has the async functions of JavaScript, and it types the result as Promise<T>.
  • The return type of an async function must be a Promise type. A return name in load gives a Promise<string>.
  • The type checker finds some missing awaits, for example a Promise<number> used where a number is needed.
RustGitHub
use std::future::{Future, poll_fn};
use std::pin::pin;
use std::sync::{Arc, Mutex};
use std::task::{Context, Poll, Wake, Waker};
use std::thread::{self, Thread};
use std::time::Duration;

// The standard library has no executor. This one runs a single future
// on the current thread and parks the thread while the future waits.
struct Unparker(Thread);

impl Wake for Unparker {
    fn wake(self: Arc<Self>) {
        self.0.unpark();
    }
}

fn block_on<F: Future>(future: F) -> F::Output {
    let mut future = pin!(future);
    let waker = Waker::from(Arc::new(Unparker(thread::current())));
    let mut cx = Context::from_waker(&waker);
    loop {
        if let Poll::Ready(value) = future.as_mut().poll(&mut cx) {
            return value;
        }
        thread::park();
    }
}

// A timer future. On the first poll it starts a thread that sleeps
// and then calls the waker.
fn sleep(delay: Duration) -> impl Future<Output = ()> {
    let done = Arc::new(Mutex::new(false));
    let mut started = false;
    poll_fn(move |cx| {
        if *done.lock().unwrap() {
            return Poll::Ready(());
        }
        if !started {
            started = true;
            let (done, waker) = (Arc::clone(&done), cx.waker().clone());
            thread::spawn(move || {
                thread::sleep(delay);
                *done.lock().unwrap() = true;
                waker.wake();
            });
        }
        Poll::Pending
    })
}

// Poll two futures until both are ready.
async fn join<A: Future, B: Future>(a: A, b: B) -> (A::Output, B::Output) {
    let (mut a, mut b) = (pin!(a), pin!(b));
    let (mut ra, mut rb) = (None, None);
    poll_fn(|cx| {
        if ra.is_none()
            && let Poll::Ready(v) = a.as_mut().poll(cx)
        {
            ra = Some(v);
        }
        if rb.is_none()
            && let Poll::Ready(v) = b.as_mut().poll(cx)
        {
            rb = Some(v);
        }
        if ra.is_some() && rb.is_some() {
            Poll::Ready((ra.take().unwrap(), rb.take().unwrap()))
        } else {
            Poll::Pending
        }
    })
    .await
}

async fn load(name: &str, ms: u64) -> &str {
    println!("start {name}");
    sleep(Duration::from_millis(ms)).await;
    println!("end {name}");
    name
}

fn main() {
    let results = block_on(join(load("slow", 200), load("fast", 100)));
    println!("{}, {}", results.0, results.1);
}
Output
start slow
start fast
end fast
end slow
slow, fast
  • Verdict: native. An async fn returns a value that implements Future, and .await suspends the async function until that future is ready.
  • A future does nothing until something polls it. The standard library defines Future, Waker and Context, but it has no executor and no timer. This example writes a small executor (block_on), a timer (sleep) and join, so it needs no library. Programs usually take these from an async runtime library.
  • The executor parks the thread while the future is pending. The timer thread calls the waker, which unparks it, and the executor polls again.
  • The compiler warns when a future is created and never used:

This code runs but gives a wrong answer on purpose.

async fn save(record: &str) {
    println!("saved {record}");
}

fn main() {
    save("order 1");
    println!("done");
}
Output
done

The body of save never runs. The compiler warning is "unused implementer of Future that must be used", with the note "futures do nothing unless you .await or poll them".

KotlinGitHub
import java.util.PriorityQueue
import kotlin.coroutines.Continuation
import kotlin.coroutines.EmptyCoroutineContext
import kotlin.coroutines.resume
import kotlin.coroutines.startCoroutine
import kotlin.coroutines.suspendCoroutine

// The event loop: suspended coroutines that wait for a time, earliest first.
class Timer(val due: Long, val continuation: Continuation<Unit>)

val timers = PriorityQueue<Timer>(compareBy { it.due })

fun nowMillis() = System.nanoTime() / 1_000_000

suspend fun sleep(ms: Long) = suspendCoroutine { continuation ->
    timers.add(Timer(nowMillis() + ms, continuation))
}

suspend fun load(name: String, ms: Long): String {
    println("start $name")
    sleep(ms)
    println("end $name")
    return name
}

fun main() {
    val results = arrayOfNulls<String>(2)
    val jobs = listOf("slow" to 200L, "fast" to 100L)
    for ((i, job) in jobs.withIndex()) {
        val done = Continuation<String>(EmptyCoroutineContext) { results[i] = it.getOrThrow() }
        suspend { load(job.first, job.second) }.startCoroutine(done)
    }
    while (timers.isNotEmpty()) {
        val next = timers.poll()
        Thread.sleep(maxOf(0, next.due - nowMillis()))
        next.continuation.resume(Unit)
    }
    println(results.joinToString(", "))
}
Output
start slow
start fast
end fast
end slow
slow, fast
  • Verdict: native. A suspend fun can suspend at a call of another suspending function. There is no await keyword: a call of a suspending function suspends when it must.
  • The standard library gives only the primitives: Continuation, startCoroutine and suspendCoroutine. This example builds a timer queue on them as the event loop.
  • Programs usually use the library kotlinx.coroutines. It gives launch, async, await, delay, dispatchers and structured concurrency with coroutineScope.
  • Stackless and stackful coroutines. Async/await in Python, JavaScript, C#, Rust, C++ and Kotlin is stackless: only the async function becomes a state machine, so each caller on the path must also be async and must await. Go goroutines and Java virtual threads are stackful: the runtime saves the whole stack, so any function can block, and no function needs a mark.
  • Function colour. Because only async functions can await, a code base splits into async and sync functions, and a sync function cannot call an async one in the normal way. Bob Nystrom named this the problem of function colour.30
  • Futures and promises with callbacks. A future is a placeholder for a result that a computation will give later.23 Before async/await, code attached callbacks to it (then in JavaScript, ContinueWith in C#). Async/await is syntax over the same objects.
  • Lazy and eager futures. A Rust future does nothing until it is polled.15 A Python coroutine does not run until it is awaited or scheduled.4 A JavaScript promise and a C# task are already running when the call returns.
  • Structured concurrency. asyncio.TaskGroup in Python and coroutineScope in kotlinx.coroutines tie the life of child tasks to a block. The block waits for all children, and an error in one child cancels the others.3119
  • Async iteration and cleanup. Python has async for, which awaits the next item of an asynchronous iterator, and async with, which awaits the enter and exit steps of a context manager.1

Pitfalls

A call without await

A call of an async function does not wait for its result. In Python, the coroutine does not even start, so the save never happens.

This code runs but gives a wrong answer on purpose.

import asyncio


async def save(record):
    print("saved", record)


async def main():
    save("order 1")
    print("done")


asyncio.run(main())
Output
done

Python prints RuntimeWarning: coroutine 'save' was never awaited on standard error when the coroutine object is destroyed.7 The fix is await save("order 1"). In JavaScript, the body runs, but the caller gets a Promise, not the value:

This code runs but gives a wrong answer on purpose.

async function loadTotal() {
  return 41;
}

const total = loadTotal();
console.log(total + 1);
Output
[object Promise]1

The fix is const total = await loadTotal(); inside an async function. With type checking, TypeScript rejects this code with error TS2365, because + cannot take a Promise<number>. The Rust compiler warns that the future is unused (see the Rust example).

A blocking call stops every task

time.sleep blocks the thread, and the event loop runs on that thread. No other task can run until it returns, so the two loads run one after the other.6

This code runs but gives a wrong answer on purpose.

import asyncio
import time


async def load(name, delay):
    print("start", name)
    time.sleep(delay)
    print("end", name)
    return name


async def main():
    results = await asyncio.gather(load("slow", 0.2), load("fast", 0.1))
    print(results)


asyncio.run(main())
Output
start slow
end slow
start fast
end fast
['slow', 'fast']

The fix is the async form of the call, here await asyncio.sleep(delay). For a blocking function that has no async form, await asyncio.to_thread(function, ...) runs it in another thread.32 Long computations need the same care, because the loop cannot stop a task that does not await.

Awaits in sequence where concurrency was meant

Each await waits for its result before the next line runs. Two awaits in a row run the loads one after the other and take the sum of the times, 300 ms here.

This code runs but gives a wrong answer on purpose.

const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));

async function load(name, ms) {
  console.log("start", name);
  await sleep(ms);
  console.log("end", name);
  return name;
}

async function main() {
  const slow = await load("slow", 200);
  const fast = await load("fast", 100);
  console.log([slow, fast].join(", "));
}

main();
Output
start slow
end slow
start fast
end fast
slow, fast

The fix is to start both and then await both: Promise.all in JavaScript (see the JavaScript example), asyncio.gather in Python, Task.WhenAll in C#.12

Await outside an async function

await is a syntax error in a function that is not async.3

This code does not compile, on purpose.

import asyncio


def report():
    value = await asyncio.sleep(0.1, result=42)
    print(value)

Python stops with SyntaxError: 'await' outside async function. The fix is to make the caller async, and to start the outermost coroutine with asyncio.run. This is the colour problem of Variations: the change goes up the whole chain of callers.

A task with no reference can disappear

The asyncio event loop keeps only weak references to tasks. A task from asyncio.create_task that nothing else refers to may be garbage collected before it is done.5 Keep each task in a variable or a set until it ends, or start it in an asyncio.TaskGroup.

Cost

  • State per task. A suspended async function keeps only the variables that it needs after the suspension point, not a whole thread stack. In Rust, the size of the future is known at compile time. A buffer that is still alive at an await is part of the future:
use std::future::{Future, poll_fn};
use std::task::Poll;

// A future that is pending once, so an async fn can await it.
fn yield_once() -> impl Future<Output = ()> {
    let mut polled = false;
    poll_fn(move |_| {
        if polled {
            Poll::Ready(())
        } else {
            polled = true;
            Poll::Pending
        }
    })
}

async fn sum_before_await() -> u32 {
    let total = {
        let buffer = [1u8; 1024];
        buffer.iter().map(|&b| u32::from(b)).sum()
    };
    yield_once().await;
    total
}

async fn sum_after_await() -> u32 {
    let buffer = [1u8; 1024];
    yield_once().await;
    buffer.iter().map(|&b| u32::from(b)).sum()
}

fn main() {
    println!(
        "buffer dropped before await: {} bytes",
        size_of_val(&sum_before_await())
    );
    println!(
        "buffer kept across await: {} bytes",
        size_of_val(&sum_after_await())
    );
}
Output
buffer dropped before await: 8 bytes
buffer kept across await: 1026 bytes
  • Allocation. A Rust future is a plain value. It goes on the heap only when the program boxes it or gives it to an executor that stores it. A C++ coroutine gets its state from an allocation function, unless the compiler can elide it.16 A C# async method allocates a Task for its result. ValueTask<T> avoids the allocation when the method often completes without a suspension.13
  • Resumption. In JavaScript, each await resumes through the job queue, even when the value is already there (see How it works).9 An await is cheap, but it is not free, so a tight loop that awaits on each pass pays it on each pass.
  • Threads. Async/await does not add parallelism. Python and JavaScript run the tasks of one loop on one thread. CPU-heavy work needs threads, processes or workers. C# and Rust executors can run tasks on a pool of threads, and then the code between awaits needs the same care with shared data as threaded code.

History

  • 1977. Henry Baker and Carl Hewitt described futures: a value that stands for the result of a computation that runs on its own.23
  • 2007. F# added asynchronous workflows, which write asynchronous code with sequential syntax and resume after each wait. The 2011 paper by Syme, Petricek and Lomov describes the model.24
  • 2012. C# 5.0 added the async and await keywords.25
  • 2015. PEP 492 added async def and await to Python. Before this, asyncio code used generators and yield from.1
  • 2017. Async functions became part of ECMAScript 2017.26
  • 2018 to 2020. Kotlin 1.3 made coroutines stable (2018).27 Rust stabilized async and .await in 2019.28 C++20 took coroutines from the Coroutines Technical Specification.29

References

  1. PEP 492: Coroutines with async and await syntax, Specification; Why StopAsyncIteration?
  2. The Python Language Reference, Compound statements, Python 3.14, Coroutine function definition
  3. The Python Language Reference, Expressions, Python 3.14, Await expression
  4. Python 3.14 documentation, Coroutines and Tasks, Coroutines; Running Tasks Concurrently, asyncio.gather
  5. Python 3.14 documentation, Coroutines and Tasks, Creating Tasks, asyncio.create_task, the note on references
  6. Python 3.14 documentation, Developing with asyncio, Running Blocking Code
  7. Python 3.14 documentation, Developing with asyncio, Detect never-awaited coroutines
  8. ECMA-262, ECMAScript 2026 Language Specification, 15.8 Async Function Definitions
  9. ECMA-262, ECMAScript 2026 Language Specification, 27.7.5.3 Await
  10. ECMA-262, ECMAScript 2026 Language Specification, 9.5 Jobs and Host Operations to Enqueue Jobs
  11. C# language reference, async, the paragraph on how an async method runs until its first await
  12. C# documentation, Asynchronous programming with async and await, Start tasks concurrently; Await tasks efficiently
  13. .NET API reference, ValueTask<TResult> Struct, Remarks
  14. The Rust Reference, Await expressions
  15. Rust standard library, Trait Future, Runtime characteristics
  16. Working Draft, Programming Languages, C++ (N4950, the C++23 draft), [dcl.fct.def.coroutine], paragraphs 1 and 9
  17. Working Draft, Programming Languages, C++ (N4950, the C++23 draft), [expr.await]
  18. P3552R3: Add a Coroutine Task Type, Proposal
  19. Kotlin documentation, Coroutines basics, the introduction to suspending functions and the kotlinx.coroutines library
  20. Kotlin standard library API, package kotlin.coroutines, Continuation, startCoroutine, suspendCoroutine
  21. JEP 444: Virtual Threads, Summary; Goals
  22. The Go Programming Language Specification, Go statements
  23. Henry G. Baker Jr. and Carl Hewitt, The incremental garbage collection of processes, ACM SIGPLAN Notices 12(8), 1977, the definition of futures
  24. Don Syme, Tomas Petricek and Dmitry Lomov, The F# Asynchronous Programming Model, PADL 2011, Introduction (asynchronous workflows in F#)
  25. The history of C#, C# version 5.0
  26. TC39, Finished Proposals, Async functions, expected publication year 2017
  27. What's new in Kotlin 1.3, Coroutines release
  28. Async-await on stable Rust! (Rust blog, 2019-11-07), the announcement
  29. P0912R5: Merge Coroutines TS into C++20 working draft, Proposal
  30. Bob Nystrom, What Color is Your Function? (2015), the whole essay
  31. Python 3.14 documentation, Coroutines and Tasks, Task Groups
  32. Python 3.14 documentation, Coroutines and Tasks, Running in Threads, asyncio.to_thread
  33. Go FAQ, Why goroutines instead of threads?

About this page

The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW4 complete
  • a review of the text: no review record reviews/QC13M3/text.yaml