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())
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.
- Take a task that can run, and resume it.
- 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.
- When no task can run, wait for the next timer or for the operating system to report a ready socket.
- 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");
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
| Language | Verdict | Note |
|---|---|---|
| Python | Native | |
| C++ | Native | |
| Java | Absent | The language has no async functions and no await. Alternative: Virtual threads (JEP 444) with blocking code, or CompletableFuture with callbacks. |
| C | Absent | The standard has no coroutines and no event loop. Alternative: Callbacks with an event library, or one thread for each blocking job. |
| C# | Native | |
| JavaScript | Native | |
| TypeScript | Native | |
| Go | Absent | The language has no async functions and no await. Alternative: Goroutines and channels; the runtime multiplexes goroutines onto threads. |
| Rust | Native | |
| Kotlin | Native | |
| SQL | Does not apply | A query does not control its own scheduling. |
| Bash | Absent | A function cannot suspend and resume. Alternative: Background processes with & and wait. |
| PowerShell | Absent | A script block cannot suspend and resume. Alternative: Thread jobs (Start-ThreadJob) and ForEach-Object -Parallel. |
| HTML | Does not apply | Markup has no control flow. |
| CSS | Does not apply | Style rules have no control flow. |
| Regular expressions | Does not apply | A 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.
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())
start slow
start fast
end fast
end slow
['slow', 'fast']
- Verdict: native.
async defmakes a coroutine function, andawaitsuspends it. - The
asynciopackage of the standard library gives the event loop, tasks, timers and network streams.asyncio.runstarts 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_taskorasyncio.gatherschedules it. asyncio.TaskGroupstarts 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]);
}
start slow
start fast
end fast
end slow
slow, fast
- Verdict: native. A function that contains
co_await,co_yieldorco_returnis 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 awaitableSleepand a timer queue as the event loop. Programs usually take these from a library. The C++26 working draft addsstd::execution::task. Detachedstarts at once and frees its state at the end. The results go into strings that live inmain, 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));
start slow
start fast
end fast
end slow
slow, fast
- Verdict: native. An
asyncmethod returnsTask,Task<T>orValueTask<T>, andawaitsuspends it until the awaited task completes. - The method runs at once, up to the first
awaitof a task that is not complete. Task.WhenAllwaits 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
awaitin the main file makes the generatedMainmethod async.
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();
start slow
start fast
end fast
end slow
slow, fast
- Verdict: native. An
async functionreturns aPromise, andawaitsuspends 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.allwaits for all the promises and rejects as soon as one of them rejects.Promise.allSettledwaits 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.
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();
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
Promisetype. Areturn nameinloadgives aPromise<string>. - The type checker finds some missing awaits, for example a
Promise<number>used where anumberis needed.
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);
}
start slow
start fast
end fast
end slow
slow, fast
- Verdict: native. An
async fnreturns a value that implementsFuture, and.awaitsuspends the async function until that future is ready. - A future does nothing until something polls it. The standard library defines
Future,WakerandContext, but it has no executor and no timer. This example writes a small executor (block_on), a timer (sleep) andjoin, 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");
}
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".
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(", "))
}
start slow
start fast
end fast
end slow
slow, fast
- Verdict: native. A
suspend funcan suspend at a call of another suspending function. There is noawaitkeyword: a call of a suspending function suspends when it must. - The standard library gives only the primitives:
Continuation,startCoroutineandsuspendCoroutine. This example builds a timer queue on them as the event loop. - Programs usually use the library
kotlinx.coroutines. It giveslaunch,async,await,delay, dispatchers and structured concurrency withcoroutineScope.
Variations and related ideas
- 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 (
thenin JavaScript,ContinueWithin 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.TaskGroupin Python andcoroutineScopeinkotlinx.coroutinestie 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, andasync 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())
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);
[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())
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();
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
awaitis 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())
);
}
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
Taskfor its result.ValueTask<T>avoids the allocation when the method often completes without a suspension.13 - Resumption. In JavaScript, each
awaitresumes through the job queue, even when the value is already there (see How it works).9 Anawaitis 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
asyncandawaitkeywords.25 - 2015. PEP 492 added
async defandawaitto Python. Before this,asynciocode used generators andyield from.1 - 2017. Async functions became part of ECMAScript 2017.26
- 2018 to 2020. Kotlin 1.3 made coroutines stable (2018).27 Rust stabilized
asyncand.awaitin 2019.28 C++20 took coroutines from the Coroutines Technical Specification.29
References
- PEP 492: Coroutines with async and await syntax, Specification; Why StopAsyncIteration?
- The Python Language Reference, Compound statements, Python 3.14, Coroutine function definition
- The Python Language Reference, Expressions, Python 3.14, Await expression
- Python 3.14 documentation, Coroutines and Tasks, Coroutines; Running Tasks Concurrently, asyncio.gather
- Python 3.14 documentation, Coroutines and Tasks, Creating Tasks, asyncio.create_task, the note on references
- Python 3.14 documentation, Developing with asyncio, Running Blocking Code
- Python 3.14 documentation, Developing with asyncio, Detect never-awaited coroutines
- ECMA-262, ECMAScript 2026 Language Specification, 15.8 Async Function Definitions
- ECMA-262, ECMAScript 2026 Language Specification, 27.7.5.3 Await
- ECMA-262, ECMAScript 2026 Language Specification, 9.5 Jobs and Host Operations to Enqueue Jobs
- C# language reference, async, the paragraph on how an async method runs until its first await
- C# documentation, Asynchronous programming with async and await, Start tasks concurrently; Await tasks efficiently
- .NET API reference, ValueTask<TResult> Struct, Remarks
- The Rust Reference, Await expressions
- Rust standard library, Trait Future, Runtime characteristics
- Working Draft, Programming Languages, C++ (N4950, the C++23 draft), [dcl.fct.def.coroutine], paragraphs 1 and 9
- Working Draft, Programming Languages, C++ (N4950, the C++23 draft), [expr.await]
- P3552R3: Add a Coroutine Task Type, Proposal
- Kotlin documentation, Coroutines basics, the introduction to suspending functions and the kotlinx.coroutines library
- Kotlin standard library API, package kotlin.coroutines, Continuation, startCoroutine, suspendCoroutine
- JEP 444: Virtual Threads, Summary; Goals
- The Go Programming Language Specification, Go statements
- Henry G. Baker Jr. and Carl Hewitt, The incremental garbage collection of processes, ACM SIGPLAN Notices 12(8), 1977, the definition of futures
- Don Syme, Tomas Petricek and Dmitry Lomov, The F# Asynchronous Programming Model, PADL 2011, Introduction (asynchronous workflows in F#)
- The history of C#, C# version 5.0
- TC39, Finished Proposals, Async functions, expected publication year 2017
- What's new in Kotlin 1.3, Coroutines release
- Async-await on stable Rust! (Rust blog, 2019-11-07), the announcement
- P0912R5: Merge Coroutines TS into C++20 working draft, Proposal
- Bob Nystrom, What Color is Your Function? (2015), the whole essay
- Python 3.14 documentation, Coroutines and Tasks, Task Groups
- Python 3.14 documentation, Coroutines and Tasks, Running in Threads, asyncio.to_thread
- 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.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag QC13M3 Edit this page History Report an error Markdown