type Polling int Values
PollingServing | iota | PollingServing means the loop serves, or drains what it holds after a stop. |
|---|---|---|
PollingRetired | PollingRetired means the loop drained or cut everything after Server.Stop. |
Ask your coding agent about this page, or add the docs server to it
curl -s 'https://www.unum.cloud/docs/ucall/go/threads-and-polling.md' | claude -p "How would this fit my code?"The package starts no goroutines: every callback runs on a goroutine the application gave to a polling call, which stays on one thread for that call.
TakeCall or TakeCalls for the event loop that received the request.PooledBatch handler runs on the goroutine inside TakeBatch or TakeBatches for its endpoint, never on an event loop, while a LocalBatch handler runs inside TakeCall or TakeCalls for the loop whose requests it holds.TakeCompleted or a blocking call.Each event loop and each batch endpoint has one polling owner at a time. TakeCalls and TakeBatches run until Server.Stop, while TakeCall and TakeBatch return after one round, waiting up to their timeout, so a loop of them interleaves polling with other work; TakeCall answers PollingRetired once the loop drained after a stop. Server.Stop works from any goroutine, handlers included, and wakes every polling goroutine; Server.Close frees the server once they returned.
The first stop drains, answering every request already held before its connection closes, and a second one cuts the replies still in flight.
A Request and a Response move between goroutines, while a Client is used by one goroutine at a time.
Every thread that polls, replies or reads must run on a CPU supporting the CPU class the server or client resolved at start, so CPUClassSerial is the safe choice on machines mixing CPU generations.
PollingPolling is what Server.TakeCall found of its event loop.type Polling int PollingServing | iota | PollingServing means the loop serves, or drains what it holds after a stop. |
|---|---|---|
PollingRetired | PollingRetired means the loop drained or cut everything after Server.Stop. |
CPUClassCPUClass is a bundle of CPU kernels; CPUClassUnknown sets no ceiling.2type CPUClass int32 CPUClassUnknown | CPUClassUnknown sets no ceiling, picking the newest class the machine runs. | |
|---|---|---|
CPUClassSerial | CPUClassSerial runs portable kernels with no SIMD on every machine. | |
CPUClassMonoversioned | CPUClassMonoversioned is the one class a monoversioned build compiles. | |
CPUClassIntelHaswell | CPUClassIntelHaswell runs AVX2 kernels. | |
CPUClassIntelSkylake | CPUClassIntelSkylake adds AVX-512 kernels. | |
CPUClassIntelIcelake | CPUClassIntelIcelake adds Ice Lake's AVX-512 extensions and SHA. | |
CPUClassIntelAlder | CPUClassIntelAlder runs AVX2 kernels with SHA and no AVX-512. | |
CPUClassAWSG2 | CPUClassAWSG2 runs NEON kernels with the AES and SHA extensions. | |
CPUClassAppleM4 | CPUClassAppleM4 adds timed waits to the Graviton5 kernels. | |
CPUClassAWSG5 | CPUClassAWSG5 runs the Graviton2 kernels with newer atomics. | |
CPUClassAlibabaC930 | CPUClassAlibabaC930 runs RVV kernels with Zawrs waits and Zacas compare-and-swap. | |
CPUClassIBMPower10 | CPUClassIBMPower10 runs VSX kernels with short pauses and store atomics. |
CPUClassFromNameCPUClassFromName reads a class back from its stable name, "unknown" included.func CPUClassFromName(name string) (CPUClass, error) StringString renders the class's stable name, such as "intel-icelake".func (class CPUClass) String() string