Skip to content
Oro Computer logooro
Runtime Silk Virtnosis Blog Docs Contact
Inside
Silk
Overview Learn Docs Spec Wiki
Silk Wiki
Start
  • Silk Wiki
Language
  • Syntax tour
  • Cheat sheet
  • Flow control overview
  • if / else
  • match
  • loop
  • while
  • for loops
  • break
  • continue
  • return
  • Expression statements
  • Blocks and statements
  • Grammar
  • Doc comments
  • Packages, imports, and exports
  • Types
  • Optionals (T?)
  • Mutability (mut)
  • Operators
  • Literals
  • Numeric literals
  • String literals
  • Character literals
  • Boolean literals
  • Duration literals
  • Duration and Instant
  • Aggregate literals (arrays and structs)
  • Structs and impl
  • Struct requirements (#require)
  • Interfaces
  • Enums
  • Errors and assertions
  • Typed errors (error, panic, and T | ErrorType...)
  • Borrow checker (design)
  • Memory model
  • Regions (with)
  • Buffers (Buffer(T)) (design)
  • Concurrency (async, task, await, yield)
  • Function disciplines (pure, async, task)
  • Const Functions (const fn)
  • Generics (monomorphized)
  • Varargs (...args)
  • External declarations (ext)
  • Testing (test)
  • Formal verification (Formal Silk)
  • Dependent types (const parameters) (design)
  • Conventions
Standard library
  • Standard library overview (std::)
  • std:: conventions
  • std:: package structure
  • std::interfaces
  • std::result
  • std::io
  • std::fmt
  • std::strings
  • std::arrays
  • std::vector
  • std::map
  • std::set
  • std::buffer
  • std::bits
  • std::algorithms
  • std::memory
  • std::args
  • std::env
  • std::process
  • std::path
  • std::fs
  • std::json
  • std::toml
  • std::url
  • std::semver
  • std::uuid
  • std::net
  • std::crypto
  • std::tls
  • std::runtime
  • std::task
  • std::sync
  • std::temporal
  • std::formal
Standard library / std::task

std::task

std::task provides hosted task/runtime helpers, including sleep/yield operations.

Full reference: task.

Example#

import std::task;

fn main () -> int {
  let n: int = available_parallelism();
  yield_now();
  sleep_ms(0);
  if n < 1 { return 1; }
  return 0;
}

See also#

  • Full reference: task
  • Concurrency model: concurrency

Source repository · Edit this page · View Markdown

Previousstd::runtime
Nextstd::sync
On this page
  • Example
  • See also
Silk Wiki
© 2026 Oro Computer. Edit this page