2017-03-03から1日間の記事一覧

Concurrency #2

https://doc.rust-lang.org/book/concurrency.html 並行処理続き。channelについて。rxからtxにデータが渡るまで、tx側は処理を待つ。 use std::thread; use std::sync::mpsc; fn main() { let (tx, rx) = mpsc::channel(); for i in 0..10 { let tx = tx.cl…