4 ms·
The whole execution contexts thing is sort of based off an assumption that the unique-&mut stuff has to do with thread safety. It doesn't. In fact, it had no be
by Manishearth 10y ago
The whole execution contexts thing is sort of based off an assumption that the unique-&mut stuff has to do with thread safety. It doesn't. In fact, it had no bearing on thread safety in Rust for the many years before scoped threads were made possible by removing the 'static bound on Send.
http://manishearth.github.io/blog/2015/05/17/the-problem-with-shared-mutability/ http://manishearth.github.io/blog/2015/05/17/the-problem-wit... details why it's necessary.
The article does sort of mention this (and I have talked with the authors about this before) but IMO it underrepresents the importance of it.
One thing I did discuss with one of the authors at one point was swapping around the guarantees a bit -- allowing multiple &mut for cases not involving any form of runtime typing (enums and vectors are both cases of runtime typing -- in a vector the number of elements is runtime dependent). This would create a significantly different language and be incompatible with the vast majority of the ecosystem; however, it would still be safe, and has the potential to be useful. I even started hacking on a fork of the compiler that does this, but never got the chance to finish it. The idea in essence is not too hard to implement.
- mathw 10y agoI get a 404 on that link.
- deleted 10y ago[deleted]
- deleted 10y ago[deleted]
- Manishearth 10y agoTry now. Octopress does this stupid thing where it generates post URIs based on the local timezone, and I published my last post whilst in Taipei so all the URLs broke. I need to figure out how to patch the code to fix this :|
- deleted 10y ago[deleted]