3 ms·
I believe what your parent was looking for is being able to pin a specific goroutine to a single CPU. If you are doing network traffic analysis, if a goroutine
by kyrra 12y ago
I believe what your parent was looking for is being able to pin a specific goroutine to a single CPU. If you are doing network traffic analysis, if a goroutine will jump between CPUs, you get the cache-miss overhead. This is the reason snort[0] (all in C) doesn't even use threads and sticks to a single process. To be able to use multiple threads when network processing you need hardware support (or something like PF_RING[1]) to distribute your load between cores. You want to be able t keep a data stream (TCP stream) pinned to a given CPU core, and doing that in Go is near impossible with how go-routines are scheduled.
[0] https://www.snort.org/ https://www.snort.org/
[1] http://www.ntop.org/products/pf_ring/ http://www.ntop.org/products/pf_ring/
- shurcooL 12y ago> You want to be able t keep a data stream (TCP stream) pinned to a given CPU core, and doing that in Go is near impossible with how go-routines are scheduled. Doesn't http://godoc.org/runtime#LockOSThread http://godoc.org/runtime#LockOSThread let you do that?