But do these types of spin locks provide the same memory effects as standard locks? I get that only one goroutine at a time can run the given block but assigning to shared vars inside the block will still need to use the methods from sync/atomic right?
On Tue, Oct 11, 2016, 22:47 <hiatt.dus...@gmail.com> wrote: > The runtime.Gosched in the spin lock is going to be quite expensive. I > found it's best to only do that every once and awhile, maybe every 100 > iterations of the loop or so (you'll want to find optimal for your case). > > > On Tuesday, October 4, 2016 at 4:09:30 AM UTC-5, sphil...@gmail.com wrote: > > Try spinlocks instead of mutexes: > https://github.com/pi/goal/blob/master/gut/spinlock.go > > -- > 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. > -- 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.