LLAM v3.0.1

Examples

Use these examples when you want to copy a small shape and adapt it. Each page focuses on one decision instead of listing every API.

  • Tasks and timers

    Spawn work, join it, sleep, and use interval timers.

  • Channels and select

    Move values between tasks and wait on multiple channel operations.

  • Runtime I/O

    Read and write without pinning scheduler workers.

  • Embedding

    Create explicit runtime handles for host-owned lifecycle.

  • Blocking work

    Run foreign blocking code through LLAM compensation paths.

How examples are labeled

Examples are labeled by intent:

Label Meaning
Complete program You can copy the whole block into a file and build around it.
Focused snippet The block belongs inside an existing task, callback, or platform setup.
Platform-specific The example depends on a named OS API such as POSIX socketpair() or Windows HANDLEs.

Complete programs in the repository

The source tree also ships larger examples:

Program Purpose
demo Small public runtime API walkthrough.
bench Runtime microbenchmarks.
stress Scheduler, sync, timeout, I/O, and dynamic-worker stress.
server Best-effort LLAM-backed TCP chat server.
server_lossless Chat server with outbox backpressure.
server_flood Native throughput driver for the chat server.
llam_broker Internal broker self-test and local transport smoke harness.

Build them from source with:

sh
make -j4
./demo
./bench
./server 7777

For production validation, use the commands in Verification.

Native C snippets in this section explicitly select *_compat runtimes. The normal runtime constructors require asynchronous admission; use the managed C guide to compile qualified task code for that path.

↑↓ Navigate↵ Openesc CloseSearching the 3.0.1 docs