{"version":"1.0","type":"rich","title":"Distributed Read-Write Mutex in Go","description":"This example compares the performance of Go’s standard `sync.RWMutex` against a custom distributed read-write mutex (DRWMutex) across increasing core counts. The plot shows mean execution time for 10 runs at each core count, with error bars for the 25th and 75th percentiles, revealing that DRWMutex outperforms `sync.RWMutex` at low write ratios. The DRWMutex assigns each CPU core its own `sync.RWMutex` and uses the CPUID instruction via assembly to determine the current core, periodically refreshing the mapping. The benchmark runs concurrent goroutines that randomly choose read or write lock operations with configurable work and write probability, using `runtime.GOMAXPROCS` and `syscall` for core affinity.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-5066ddd43072abc29df7?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}