{"categories":["Rust","\u6280\u8853"],"image_url":null,"published":"2020-10-06 21:16:44","title":"std::sync::mpsc::channel\u3067\u5c11\u3057\u30cf\u30de\u3063\u305f\u306e\u3067\u30e1\u30e2","blog_url":"https://krouton.hatenablog.com/","width":"100%","type":"rich","version":"1.0","height":"190","provider_url":"https://hatena.blog","provider_name":"Hatena Blog","url":"https://krouton.hatenablog.com/entry/2020/10/06/211644","description":"std::sync::mpsc - Rust\u306e\u6319\u52d5\u306b\u3064\u3044\u3066\u3061\u3087\u3063\u3068\u77e5\u898b\u3092\u6301\u3063\u305f\u306e\u3067\u7db4\u3063\u3066\u3044\u304f\u3002 \u3084\u308a\u305f\u3044\u3053\u3068 \u3081\u3063\u3061\u3083\u91cd\u305f\u3044\u30bf\u30b9\u30af\u304cN\u500b\u3042\u3063\u3066\u3001\u305d\u308c\u305e\u308c\u306b\u30b9\u30ec\u30c3\u30c9\u3092\u4f5c\u3063\u3066mpsc::channel\u7d4c\u7531\u3067\u30e1\u30a4\u30f3\u30b9\u30ec\u30c3\u30c9\u306b\u5024\u3092\u8fd4\u3057\u3066\u3082\u3089\u3046\u4f8b\u3092\u8003\u3048\u308b\u3002 use std::thread; use std::sync::mpsc; let (tx, rx) = mpsc::channel(); for costly_task in costly_tasks.into_iter() { let tx = mpsc::Sender::clone(&tx); thread::spawn(move || { l\u2026","author_url":"https://blog.hatena.ne.jp/Krouton/","author_name":"Krouton","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkrouton.hatenablog.com%2Fentry%2F2020%2F10%2F06%2F211644\" title=\"std::sync::mpsc::channel\u3067\u5c11\u3057\u30cf\u30de\u3063\u305f\u306e\u3067\u30e1\u30e2 - KRAZY\u611f\u60c5TEXTYLE\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","blog_title":"KRAZY\u611f\u60c5TEXTYLE"}