example padding striped mutexs from @egonelbre

This commit is contained in:
Damian Gryski 2018-04-04 23:47:22 -07:00
parent 010c1e9dc4
commit 586335a5e1

View File

@ -965,6 +965,8 @@ readers in.
If you're sharding the locks, be careful of shared cache-lines. You'll need to pad
to avoid cache-line ownership bouncing between processors.
var stripe [8]struct{ sync.Mutex; _ [7]uint64 } // mutex is 64-bits; padding fills the rest of the cacheline
## Assembly
* Stuff about writing assembly code for Go