On Fri, Mar 3, 2017 at 2:21 PM, Tharaneedharan Vilwanathan <vdhar...@gmail.com> wrote: > > I am working on some cpu-intensive Go applications. > > I want to avoid the scheduler from moving the tasks to various cores. I am > trying to pin the code to specific CPU cores and see if I can get better, > predictable performance. > > Is there any info available that documents various techniques, best > practices? I would like to try them to start with.
There is no support for this at present. There has been some discussion of it in the past but no real conclusions. The closest you can come today is to use runtime.LockOSThread to lock your goroutine to a thread, and then call syscall.Syscall(syscall.SYS_SCHED_SETAFFINITY, ...) to lock the thread to a set of CPUs. I don't really know what the overall effect on the scheduler would be. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.