6 ms·
> Rust tasks have the same large fixed-size stack as OS > threads. A fine-grained concurrency model like a task > graph would be build on top of them.
by redbad 13y ago
> Rust tasks have the same large fixed-size stack as OS
> threads. A fine-grained concurrency model like a task
> graph would be build on top of them.
In the absence of other context (I don't really know much about Rust) I would then argue that Rust tasks miss the point of CSP.
- pcwalton 13y agoI think that's unfair. There's no absolute threshold that defines "the point of CSP"; you might equally say Go's goroutines miss the point of CSP because they're slower than the equivalent for loop. Besides, the only substantive difference between Go's implementation and Rust's implementation is that Go uses segmented stacks, while Rust does not. That is because segmented or relocating stacks are in opposition to Rust's design goals of no GC, fast calling into C, and predictable performance.
- nickik 13y agoOne might say that passing raw pointers around is against the point of CSP. As I understand it go does exactly what the Singularity OS does, pass over ownership instead of copy or raw pointer. This seams more idimotic, and more CSPish to me. (Passing around pointer/references to immutables is of course ok)
- masklinn 13y ago> As I understand it go does exactly what the Singularity OS does, pass over ownership instead of copy or raw pointer. I may misunderstand what you're talking about, but as far as I know Go more or less passes a raw pointer (or a copy thereof) over pointer channels. It has no concept of ownership, and the pointer (and pointee) on the sender side remains valid: http://play.golang.org/p/E1bqrVFxZ6 http://play.golang.org/p/E1bqrVFxZ6
- deleted 13y ago[deleted]
- nickik 13y agoI mixed up go and rust. Go send around raw pointers.
- nickik 13y agoMixed up go and rust.