channel
A built-in Go language mechanism for communication and synchronization between goroutines. Channels act as typed conduits for passing data and come in two forms: unbuffered and buffered. They embody the CSP design philosophy of sharing memory through communication rather than sharing memory to communicate.
Timeline (last 90 days)
Go's concurrency model is based on goroutines and channels, and a goroutine's initial stack is only a few KB, so hundreds of thousands can be created easily.
Erlang's Actor model and Go's channel mechanism avoid shared mutable state by not sharing memory and communicating via messages, which is intuitively friendlier, but introduces new learning costs such as message ordering, mailbox overflow, and supervision tree design.
Go provides a set of built-in concurrency primitives through goroutines and channels.
Channels come in two varieties—unbuffered and buffered; a send operation on an unbuffered channel blocks until the receiver is ready, while a send on a buffered channel does not block as long as the buffer is not full.
The select statement can monitor multiple channels, implementing non-blocking operations when combined with default and timeout control when combined with time.After.
All Facts (5)
Go's concurrency model is based on goroutines and channels, and a goroutine's initial stack is only a few KB, so hundreds of thousands can be created easily.
50%UnverifiedErlang's Actor model and Go's channel mechanism avoid shared mutable state by not sharing memory and communicating via messages, which is intuitively friendlier, but introduces new learning costs such as message ordering, mailbox overflow, and supervision tree design.
50%UnverifiedGo provides a set of built-in concurrency primitives through goroutines and channels.
50%UnverifiedChannels come in two varieties—unbuffered and buffered; a send operation on an unbuffered channel blocks until the receiver is ready, while a send on a buffered channel does not block as long as the buffer is not full.
50%UnverifiedThe select statement can monitor multiple channels, implementing non-blocking operations when combined with default and timeout control when combined with time.After.
50%