4 ms·
It's pretty easy to get yourself into trouble with channels: deadlocks, send on closed, channel leaks, deadlocks "fixed" thoughtlessly with arbitrarily-sized bu
by closeparen 2mo ago
It's pretty easy to get yourself into trouble with channels: deadlocks, send on closed, channel leaks, deadlocks "fixed" thoughtlessly with arbitrarily-sized buffers, etc.
- jeffbee 2mo agoThis seems to have little to do with Go's facilities. Any concurrent program has hazards like these.
- closeparen 2mo agoIn my experience, shared memory instills the appropriate fear and caution, while the apparent simplicity of channels encourages novice Go programers to take on concurrency projects beyond their abilities and without due care. Been on both the submitter and reviewer side of that plenty of times in 10 years.
- treyd 2mo agoRust's concurrency libraries leverage the type system to make these issues much harder to encounter.
- jeffbee 2mo agoRust's std::sync::mpsc contains most of the hazards of Go's channel, and arguably adds some because the Go runtime provides deadlock detection that Rust lacks.