blocking operation

An operation that makes the code wait until something happens, such as a receive waiting for a value to arrive on a channel.

In more detail

Blocking is normal: a waiting task uses no processor time while others run. Problems start when nothing will ever unblock it, which hangs the program or leaks the waiting task. A timeout or cancellation gives a blocked wait an escape.

Example

Go: <-ch blocks until a value arrives

Related terms

Taught in

References