rust@octodon.social ("Rust tips") wrote:
#Rustlang uses the term
Sendfor making data available to another thread. ThatSendis a fictional operation that is imagined only for the sake of type checking.Data "sent" to other threads doesn't actually need to go anywhere, because all threads share the same memory.
There can be copying involved when data is passed by value using channels. This isn't because of threads, this is because channels are like a
Vec:vec.push()on one thread, andvec.pop()on another. If youBoxthe data, it won't be copied. If you use scoped threads and borrow the data instead, it won't be copied either.