You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ Goroutine-safe Copy-on-Write with `sync.Pool`. Wraps a `sync.Pool` with referenc
13
13
14
14
## Why?
15
15
16
-
Read-mostly shared resources that need periodic updates present a tradeoff:
16
+
Read-mostly shared resources that need periodic updates present a "synchronization or allocation" tradeoff:
17
17
18
18
-**In-place update under lock (e.g. `sync.RWMutex`)**: Zero-alloc - but blocks all readers during updates
19
19
-**Pointer swap + Copy-on-Write (e.g. `atomic.Pointer` or `sync.RWMutex`)**: Fast and non-blocking - but forces you to allocate a new object on each update, causing GC pressure
0 commit comments