1
0
mirror of https://github.com/golang/go synced 2024-11-06 07:26:10 -07:00
go/src/sync
Kevin Burke d42a48828f sync: add more notes about Cond behavior
Cond is difficult to use correctly (I was just bitten by it in
a production app that I inherited). While several proposals have come
up to improve or remove sync.Cond, no action has so far been taken.

Update the documentation to discourage use of sync.Cond, and point
people in the direction of preferred alternatives. I believe this will
help encourage behavior we want (less use of sync.Cond and more use of
channels), while also paving the way for, potentially, removing Cond
in a future version of the language.

Thanks very much to Bryan Mills and Sean Liao for discussion and
recommendations.

Updates #20491.
Updates #21165.

Change-Id: Ib4d0631c79d4c4d0a30027255cd43bc47cddebd3
Reviewed-on: https://go-review.googlesource.com/c/go/+/412237
Run-TryBot: Ian Lance Taylor <iant@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Reviewed-by: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@google.com>
2022-06-17 21:35:36 +00:00
..
atomic sync/atomic: clarify that 8-byte alignment of variables is due to escape 2022-06-07 17:44:51 +00:00
cond_test.go
cond.go sync: add more notes about Cond behavior 2022-06-17 21:35:36 +00:00
example_pool_test.go
example_test.go
export_test.go
map_bench_test.go
map_reference_test.go
map_test.go
map.go runtime, sync, sync/atomic: document happens-before guarantees 2022-06-06 20:48:03 +00:00
mutex_test.go runtime: write much more direct test for semaphore waiter scalability 2022-06-16 21:25:35 +00:00
mutex.go runtime, sync, sync/atomic: document happens-before guarantees 2022-06-06 20:48:03 +00:00
once_test.go
once.go runtime, sync, sync/atomic: document happens-before guarantees 2022-06-06 20:48:03 +00:00
pool_test.go all: separate doc comment from //go: directives 2022-04-05 17:54:15 +00:00
pool.go runtime, sync, sync/atomic: document happens-before guarantees 2022-06-06 20:48:03 +00:00
poolqueue.go
runtime2_lockrank.go
runtime2.go
runtime_sema_test.go
runtime.go
rwmutex_test.go
rwmutex.go runtime, sync, sync/atomic: document happens-before guarantees 2022-06-06 20:48:03 +00:00
waitgroup_test.go
waitgroup.go runtime, sync, sync/atomic: document happens-before guarantees 2022-06-06 20:48:03 +00:00