This thread brings to mind a couple of issues that I'd like to just
float for your consideration.
1) Many apps build up massive immutable data structures that need to be
accessed by tons of tasks (e.g. video games, my field). Copying these
values would be prohibitively impractical, so any general-purpose
language /must/ support real sharing of immutable data somehow.
Realistically, before Rust sees mainstream use we'll have >64 cores to
keep busy, so anything that imposes limits on read-only data sharing
between actual /cores/ is going to be a big burden too.
If we have destructors only on non copyable data then there is no other
user visible side effect on copying versus sharing and that can be
optimized by the compiler and run time, no? In particular:
*) In a green thread, share and ref-count
*) If the data is small, copy.
*) If the data is big, share with atomic ops
If the change in performance characteristics are too big and we cannot
optimize them in a reliable way, we can make an option at send to force
sharing. Given that that should have no other user visible change, I
think we can deffer this particular decision a bit.
Happy holidays!
Sebastian
--
Sebastian Sylvan
Thanks,
Rafael
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev