TSCONTTHREADAFFINITYSET(3ts)
π TSCONTTHREADAFFINITYSET π
okay bestie, welcome to the Apache Traffic Server manual, section 3ts. today's main character is TSContThreadAffinitySet β the API function that lets you pick exactly which event thread your continuation gets to hang out on. no more "wherever the scheduler feels like it" energy. we're choosing. we're committing. periodt. π
β¨ NAME β¨
TSContThreadAffinitySet β the TSContThreadAffinitySet API function π
πΈ SYNOPSIS πΈ
#include <ts/ts.h>
TSReturnCode TSContThreadAffinitySet(TSCont contp, TSEventThread
ethread)
π¦ DESCRIPTION π¦
So here's the vibe: you call this and you set the thread affinity of the continuation contp to ethread. like, you're basically matchmaking your continuation with a specific event thread and saying "this one. this is the one. π
"
From then on, any future calls to TSContSchedule(), plus any TSContScheduleOnPool() calls that have the same type as ethread, will schedule the continuation on ethread β instead of yeeting it onto some arbitrary thread of that type. no cap. it's giving β¨destinyβ¨.
Also important, and lowkey the plot twist: TSContSchedule() and TSContScheduleEvery() will default the affinity to the calling thread when you invoke them without explicitly setting the thread affinity. so if you never call this function, the calling thread is the default bestie. π«Ά
π« RETURN VALUES π«
TS_SUCCESSβ yay! π the thread affinity of continuationcontpwas set toethread.TS_ERRORβ nope. π it was not.
π COPYRIGHT π
2026, dev@trafficserver.apache.org
and that's the whole page, bestie. every flag, every value, every word β untouched, just β¨glowed upβ¨. go set some thread affinity, you iconic thing. ππ
9.2 β Feb 12, 2026 β TSCONTTHREADAFFINITYSET(3ts) πΈ slay, bye!! π
β¨
π¦ where this page comes from
- ubuntu noble: trafficserver-dev 9.2.3+ds-1+deb12u1ubuntu0.1 Β· Apache-2.0
- ubuntu questing: trafficserver-dev 9.2.5+ds-1ubuntu2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms