Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why are channels weak?

channels weak
0
Posted

Why are channels weak?

0

To simplify reasoning about resource-ownership and resource-allocation costs. All allocated resources are (at worst) owned by the enclosing domain, and die with it. At best, Rust tries to localize resource ownership to a task or even a frame or a single allocation. Since channels can cross all such boundaries — even domains — we did not want the escape of a channel to require the system to keep the receiving-end alive beyond the lifetime of its referent. Besides which, since the receiving-end can’t escape its enclosing task — see previous FAQ — nobody could use such a kept-alive receiving end. It’s as good as dead once the owning task dies.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123