---
title: "Threads"
canonical_url: https://developer.repebble.com/pebbleos/docs/kernel/threads/
last_updated: 2026-10-21
sdk_version: 4.33.1
---
# Threads

Source: https://developer.repebble.com/pebbleos/docs/kernel/threads/

`pbl_thread_create()` takes a `struct pbl_thread_attr`: entry, priority, privileged flag, a caller-owned stack and up to four `MpuRegion`s that are switched in with the thread. With `CONFIG_USERSPACE` it also takes the memory the thread’s syscalls may use and the stack they run on ([Syscalls](https://developer.repebble.com/pebbleos/docs/kernel/syscalls.md)).

## Introspection

`debug.h` covers what core dumps, fault handling, stack checks and telemetry need: a thread walk with saved registers in the canonical order the core dump format expects, saved PC/LR/CONTROL of a blocked thread, stack bounds and high-water marks, and a run-time stats snapshot.

Generated from PebbleOS [3a7b71785](https://github.com/coredevices/pebbleos/commit/3a7b71785fd439666c4a8bc116f561140e8dec01). This page is maintained in the pebbleos repository: [docs/kernel/threads.md](https://github.com/coredevices/pebbleos/blob/3a7b71785fd439666c4a8bc116f561140e8dec01/docs/kernel/threads.md).
