I know some people are put off by stuff like this, but reading the Java JDK concurrent package provides a wealth of information- it is well documented and almost all are referenced implementations of academic papers. In this case, the Java concurrent hash map would be an applicable design. 

You can see some of this - not nearly as good or complete - in my github.com/robaho/go-concurrency-test

On Mar 14, 2025, at 12:17 AM, Jason E. Aten <j.e.a...@gmail.com> wrote:

oh nice. I like the hashing idea to pick a shard lock out of array...that way
I don't have to stick locks on, and bloat, every node in the btree. I can
just take the hash value modulo a the size of a fixed set of locks... Thanks Robert.

p.s. awl, thanks, yes... saw that. thank you.

On Friday, March 14, 2025 at 4:29:46 AM UTC Robert Engels wrote:
I think it is easier to just hash and shard the data set the lock is protecting - ie a lock per shard. 

On Mar 13, 2025, at 10:52 PM, atomly <ato...@gmail.com> wrote:


On Thu, Mar 13, 2025 at 20:29 Jason E. Aten <j.e....@gmail.com> wrote:
Is there a common way to do sharded read-write locks now?
I mean faster than sync.RWMutex.

I tried https://github.com/jonhoo/drwmutex which is from quite a
while back...

Have you read the original thread that spawned this, you might find it pretty informative if not:

--
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...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/golang-nuts/CAA_Y42wUOYwnaO0ZDyC2USCMsZqVQXGck9q%2Bfb8inWoxG01brA%40mail.gmail.com.

--
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 visit https://groups.google.com/d/msgid/golang-nuts/08738a3e-2c94-4f52-8f49-16b287303c6bn%40googlegroups.com.

--
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 visit https://groups.google.com/d/msgid/golang-nuts/5BB18FB7-E9A5-452E-A8AB-1CC323CBEEC8%40ix.netcom.com.

Reply via email to