How frangarcj/vita-pthread-ng works
vpthread-ng is a C pthread implementation for Vita, with a POSIX-compatible API and selectable Vita or Linux simulation backends. The main workflow is an application calling the POSIX shim, which delegates thread and synchronization operations to the core runtime; the runtime uses a HAL for kernel-thread and primitive operations. The core also provides cancellation, thread-specific data, cleanup, and synchronization features. Source excerpts establish several key links, but do not expose every POSIX dispatch or backend configuration detail, so uncertain connections are omitted.
Main entry points: internal.h Runtime State · posix.c POSIX Shim · hal.h HAL Selector · thread.c Thread Lifecycle
Components 20
Public APIs
- POSIX Shim
src/posix.c - pthread ABI
include/vpthread/abi/pthread.h - Core API
include/vpthread/vpthread.h
Thread Runtime
- Thread Lifecycle
src/thread.c - Cancellation
src/cancel.c - Thread-Specific Data
src/tsd.c - Runtime State
src/internal.h
Synchronization
- Mutexes
src/mutex.c - Condition Variables
src/cond.c - Read-Write Locks
src/rwlock.c - Barriers
src/barrier.c - Once Control
src/once.c
Platform Backends
- HAL Selector
include/vpthread/hal.h - Vita HAL
include/vpthread/hal_vita.h - Simulation HAL
include/vpthread/hal_sce_sim.h - Simulation API
include/vpthread/sce_sim.h - Simulation Runtime
src/sce_sim/sce_sim.c
Other components
- Application
- Vita Kernel
- Host Threads
Connections 21
- Application → POSIX Shim: calls
- POSIX Shim → pthread ABI: implements
src/posix.c - POSIX Shim → Thread Lifecycle: delegates to
- POSIX Shim → Mutexes: delegates to
src/posix.c - POSIX Shim → Read-Write Locks: delegates to
src/posix.c - Thread Lifecycle → Runtime State: uses state
src/thread.c - Mutexes → Runtime State: uses state
src/mutex.c - Thread Lifecycle → HAL Selector: uses operations
- Mutexes → HAL Selector: uses operations
- Condition Variables → Runtime State: uses state
src/cond.c - Read-Write Locks → Runtime State: uses state
src/rwlock.c - Barriers → Runtime State: uses state
src/barrier.c - Cancellation → Runtime State: uses state
src/cancel.c - Thread-Specific Data → Runtime State: uses state
src/tsd.c - Once Control → Core API: uses API
src/once.c - HAL Selector → Simulation HAL: selects
include/vpthread/hal.h - HAL Selector → Vita HAL: selects
include/vpthread/hal.h - Simulation HAL → Simulation API: uses API
include/vpthread/hal_sce_sim.h - Simulation Runtime → Simulation API: implements
src/sce_sim/sce_sim.c - Simulation Runtime → Host Threads: runs on
src/sce_sim/sce_sim.c - Vita HAL → Vita Kernel: calls
include/vpthread/hal_vita.h