From 2c5f04476cffe74be3cb8b9c6882b53446ea6479 Mon Sep 17 00:00:00 2001
From: Russ Cox
-The kth send on a channel with capacity C happens before the k+Cth receive from that channel completes. +The kth receive on a channel with capacity C happens before the k+Cth send from that channel completes.
This rule generalizes the previous rule to buffered channels. It allows a counting semaphore to be modeled by a buffered channel: -the number of items in the channel corresponds to the semaphore count, -the capacity of the channel corresponds to the semaphore maximum, +the number of items in the channel corresponds to the number of active uses, +the capacity of the channel corresponds to the maximum number of simultaneous uses, sending an item acquires the semaphore, and receiving an item releases the semaphore. -This is a common idiom for rate-limiting work. +This is a common idiom for limiting concurrency.
-- cgit v1.2.1