Suspension Point

Noun · Development

Definitions

  1. A location in a coroutine or async function where execution may be paused and the thread yielded back to the scheduler until a result is available. In Kotlin, suspension points are marked by calls to `suspend` functions; in JavaScript, they occur at `await` expressions; in Swift, at `await` keywords.

    In plain English: A spot in your code where the program can pause, go do something else, and come back later when the result is ready.

    Example: "There are two suspension points in this function — one at the network call and one at the database write — so the thread is free to do other work while we wait."

Related Terms