水木社区手机版
首页
|版面-Rust编程语言(Rust)|
新版wap站已上线
返回
1/1
|
转到
主题:why_does_arc_require_both_send_and_sync_and_not
楼主
|
txgx
|
2022-11-29 17:34:54
|
只看此ID
https://www.reddit.com/r/rust/comments/ysa5ss/why_does_arc_require_both_send_and_sync_and_not/
要求T: Send是因为可能在一个线程创建T,在另一个线程释放T;
要求T: Sync是因为可能同时在多个线程中拿到&T
--
FROM 117.147.21.*
1楼
|
littleSram
|
2022-12-01 08:31:20
|
只看此ID
rust compiler简直就是教练
【 在 txgx 的大作中提到: 】
:
https://www.reddit.com/r/rust/comments/ysa5ss/why_does_arc_require_both_send_and_sync_and_not/
: 要求T: Send是因为可能在一个线程创建T,在另一个线程释放T;
: 要求T: Sync是因为可能同时在多个线程中拿到&T
--
修改:littleSram FROM 114.249.18.*
FROM 114.249.18.*
1/1
|
转到
选择讨论区
首页
|
分区
|
热推
BYR-Team
©
2010.
KBS Dev-Team
©
2011
登录完整版