Task priorities describe how important a unit of concurrent work is.

Choose a priority label

urgent
task_priorities.swift
Replay: real traced execution (multi-file project)
let urgent = false
let priority = urgent ? "high" : "background"
let message = "priority=\(priority)"

print(message)
let urgent = true
let priority = urgent ? "high" : "background"
let message = "priority=\(priority)"

print(message)
  1. urgent ← false, priority ← background, message ← priority=background

    1let urgent→ false = false  //@urgent=true2let priority→ background = urgentfalse ? "high" : "background"3let message→ priority=background = "priority=\(prioritybackground)"45print(messagepriority=background)
    outputpriority=background
  1. urgent ← true, priority ← high, message ← priority=high

    1let urgent→ true = true2let priority→ high = urgenttrue ? "high" : "background"3let message→ priority=high = "priority=\(priorityhigh)"45print(messagepriority=high)
    outputpriority=high
task priority A priority choice is often made from input before a task is created.