'Type-safe multithreading in Cyclone' and Rust


I’ve encountered this paper http://dl.acm.org/citation.cfm?id=604177 and IMO it fits into Rust’s philosophy quite well. Since Rust have already been influenced by Cyclone, then probably it was already considered by the Rust’s language design team. And I’m curious what was the outcome? Do you find Mutex good enough to consider data race problem being solved? Do you see any problems with practical use of the described type system?



From the abstract and a quick glance at the paper, I think Rust already does that and more: http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html



As @huon says, it seems like Rust already does that. I haven’t read the paper (since I don’t particularly want to pay for it), but the abstract seems to describe things that sound similar to Send and Sync.

For the first thing the abstract mentions, “enforcing that thread-shared data is protected via locking”, is what Sync does. Though Sync is more general, representing thread-safe concurrent access instead of just locking, it exists to ensure that access to thread-shared data is safe.

The second thing the abstract mentions, “thread-local data does not escape the thread that creates it”, is handled by a combination of Send and 'static. What Send represents is actually the inverse, it indicates that data can safely escape the thread that creates it. 'static ensures that data sent between threads is valid for long enough.

In fact, Send and 'static being separate allows for Rust to express more patterns safely, notably “scoped threads” that can access data limited to the lifetime of the thread that spawned it.



All the cyclone papers are freely available here: http://cyclone.thelanguage.org/wiki/Papers/

This one in particular being: http://homes.cs.washington.edu/~djg/papers/cycthreads.pdf


closed #5

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.