rawthreads
nimony/lib/std/rawthreads.nim
const nativeThreads: boolWhether threads here are the runtime's own
clone(2)rather than an OS thread library's. True on the native (arkham + nifasm) backend, which links no libc and therefore has no pthreads; false everywhere else,nimony cincluded — that build is raw-syscall too, but libc is still linked.type RawThread = object sys: SysThread dataFn: proc (arg: pointer) {.nimcall.} data: pointer
proc create(t: out RawThread; fn: proc (arg: pointer) {.nimcall.}; arg: pointer; stackSize: int64; pinnedToCpu: int64)Spawns a thread running
fn(arg).stackSizeselects a custom stack (0 → OS default).pinnedToCpurequests CPU affinity where supported (-1leaves scheduling to the OS).proc join(t: var RawThread)Waits for the thread
tto finish.proc getThreadId(): int64Gets the ID of the currently running thread.