We need to allocate resources from a host (disk, memory, CPU) dynamically per container, and when full, wait for resources to free up. Meanwhile, if any of the existing containers free up, we can use them and abandon attempting to allocate more resources.
This problem is called a covering condition [1] Remzi H. Arpaci-Dusseau and Andrea C. Arpaci-Dusseau, Operating Systems: Three Easy Pieces, 30.3, 2015 [2] B.W. Lampson, D.R. Redell, Experience with Processes and Monitors in Mesa, pg. 105, 1980
Mostly, it's an issue of complexity. We could implement this all with channels, but we'd need a few things: ● requests wait over resource allocation channel ● a thread (or synchronization) that manages resource allocation channels & their requested sizes (FIFO), and separately receives wake up calls when resources are freed and doles them out (and handles when allocs gave up efficiently) ● to figure out whatever the hell data structure ^ is
What we accomplished: ● Now we can wait for resources OR a container to free up, OR a request timeout, using a select statement ● You were duped into watching an advertisement for the Fn Project under the false pretense that you might learn something from somebody you have never heard of