It is recommended that threads support context transfer and automatically perform clone operations #133795
Labels
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-lang
Relevant to the language team
Uh oh!
There was an error while loading. Please reload this page.
Code
It is recommended that threads support context. As shown in the figure, the context automatically performs cloning operations, which can avoid code, like this let handle = thread::spawn(move |sx, rx| {} not sx.clone(), rx.clone()。
This operation can be understood as opening an isolation domain. Or abstract it into a more general concept. Rust allows the creation of isolated domains. All external borrowing in the isolation domain is automatically recognized as a clone operation
The text was updated successfully, but these errors were encountered: