2 ms·
> The Rust async book mentions three more methods: […] Hah, I wrote this section and was deeply aware of these problems at the time. Let’s just say it didn’t f
by klabb3 2y ago
> The Rust async book mentions three more methods: […]
Hah, I wrote this section and was deeply aware of these problems at the time. Let’s just say it didn’t fit in the introduction. In fact, a lot of the understanding of this issue has been expressed later, blog post by blog post, largely without coordination. It’s almost eerie to see again and again people encountering the same issue, and spending huge effort to address it (this one takes the prize though - making your own language).
Let me try a to narrativize it: we have a fundamental problem with unrestricted concurrent control flow (very similar to how we used to have unrestricted sequential control flow when we had goto). This problem exists in most programming languages, but we mostly pretend it’s not there (and live with the subtle bugs instead). However, with Rust’s unique ownership- and safety model, the lack of structured concurrency was an unavoidable problem, at collision course with Rust itself. In the Rust we have today (without structured concurrency), a bunch of expected and reasonable behaviors cannot be achieved (such as borrowing from a parent task).
- throwaway17_17 2y agoDo you know of any longer form content that walks through this area, or maybe just a listing of blogs. I have a feeling the resources are relatively scattered over various sites and across time, so any tips on search terms to use if a deep dive into this problem (both in Rust and generically in programming language semantics) intrigues me?
- genter 2y agohttps://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/ https://vorpus.org/blog/notes-on-structured-concurrency-or-g... https://dubroy.com/blog/handling-user-input-with-structured-concurrency/ https://dubroy.com/blog/handling-user-input-with-structured-... The first one is particularly good. Both of those have links to more topics.
- klabb3 2y agoSibling already gave great pointers to structured concurrency in general. For rust specifically the links in the post were good, some I hadn’t seen that came up in the last 2 years. Perhaps someone from deep PL background has more rigorous papers and such to point to? I highly doubt this is being discovered now for the first time – it wouldn’t surprise me if there’s a whole academic sub-branch about similar things. Given how important concurrency is, and how difficult it is to get right, there’s a lot of opportunity for academia to tackle the problem space. We sure as hell need it.