>> I took some time to put this to a test. The Go program here
>> https://go.dev/play/p/378Zn_ZQNaz uses a VERY short holding of the
>> lock - but a large % of runtime holding the lock.

> Thanks for the benchmark.  You're right: if you have hundreds of
> goroutines doing nothing but acquiring a read lock, then an RWMutex
> can be faster.  They key there is that there are always multiple
> goroutines waiting for the lock.

Could you please explain that?  You previously implied that the
required atomic operation is going to make the difference between the
two kinds of mutex irrelevant, why does the argument not apply here?

Thanks,

-- Juliusz

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/87tu00b8b3.fsf%40pirx.irif.fr.

Reply via email to