OneOfOne / lfchan

A scalable lock-free channel.
Apache License 2.0
134 stars 5 forks source link

Probably want to use runtime.GOMAXPROCS() instead of runtime.NumCPU() for sleeps #1

Closed dbudworth closed 8 years ago

dbudworth commented 8 years ago

In your spin locks, you are using NumCPU, which is fine if GOMAXPROCS == NumCPU

If someone is limiting max procs for some reason, then you are sleeping less often than you intend as you are currently doing ncpu * 100.

OneOfOne commented 8 years ago

Good catch