This question already has an answer here:
I need to run a number of go routines and bind them to separate CPU cores for a benchmark test.
I've tried with runtime.LockOSThread() but this degrades performance significantly. I do not want to lock go rountines to specific threads and in my understanding LockOSThread does just that.
Ex: If I have n goroutines where n>1 they should be bound to n cores where GOMAXPROCS >= n. That is each goroutine is always scheduled on the same core.
</div>
Full details can be found here