[rust学习]三、 rust中的并发 (TODO)

一、线程间通信方式: channel 1 use std::sync::mpsc; 2 use std::thread; 3 4 fn main() { 5 let (tx, rx) = mpsc::channel(); 6 7 thread::spawn(move || { 8 let val =
posted @ 2023-04-04 20:25  朝花不夕拾  阅读(75)  评论(0编辑  收藏  举报