Comment by kbolino

Comment by kbolino a day ago

1 reply

There's also atomic operations (sync/atomic) and higher-level abstractions built on atomics and/or mutexes (sempahores, sync.Once, sync.WaitGroup/errgroup.Group, etc.). I've used these and seen them used by others.

But yeah, the CSP model is mostly dead. I think the language authors' insistence that goroutines should not be addressable or even preemptible from user code makes this inevitable.

Practical Go concurrency owes more to its green threads and colorless functions than its channels.

diarrhea a day ago

> colorless

Functions are colored: those taking context.Context and those who don't.

But I agree, this is very faint coloring compared to async implementations. One is free to context.Background() liberally.