thc:runtime
Copyright(C) 2026 Edward Kmett
LicenseUPL-1.0 AND BSD-3-Clause
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
PortabilityGHC FFI; THC runtime services or native fallback implementation
Safe HaskellSafe
LanguageHaskell2010

THC

Description

Small, stable runtime facade. Detailed services are in THC.Thread, THC.Memory, THC.GC and THC.Trace. Hazardous/internal controls are not re-exported; THC.Internal.JIT must be imported explicitly.

Synopsis

Documentation

cpuAffinitySupport :: IO CpuAffinitySupport Source #

Compatibility query preserving the original API. Native GHC returns NoCpuAffinity: ordinary GHC forkOn promises a capability, not a physical CPU. This does not inspect +RTS -qa. For detailed failure status, inspect threadAffinitySupport in currentThreadInfo.

affinityApplied :: IO Bool Source #

Did this registered THC fork's initial native request succeed? False also covers unavailable support or no request. Acceptance is not a bound-thread TLS guarantee, nor a promise against subsequent OS policy changes.

forkOnWithAffinity :: Int -> (Bool -> IO ()) -> IO ThreadId Source #

Like forkOn, with the child's initial native-affinity acceptance. The callback always runs, including unavailable/rejected affinity. Preserves lazy action evaluation and inherited masking. The integer is a capability index, not an OS CPU ID; advisory acceptance remains advisory.