検索

phrase: max: clip:
target: order:
Results of 1 - 2 of about 2 for ThreadPool (0.014 sec.)
シングルスレッドサーバをマルチスレッド化する - Rust 日本語版 11228
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... 。リスト20-12は、 thread::spawn の代わりに使用したい ThreadPool 構造体の架空のインターフェイスを表示しています。 フ ... :net::TcpListener; use std::net::TcpStream; struct ThreadPool; impl ThreadPool { fn new(size: u32) -> ThreadPool ... { ThreadPool } fn execute<F>(&self, f: F) where F: FnOnce() + S ... tener::bind("127.0.0.1:7878").unwrap(); let pool = ThreadPool::new(4); for stream in listener.incoming() { let s ...
https://man.plustar.jp/rust/book/ch20-02-multithreaded.html - [similar]
正常なシャットダウンと片付け - Rust 日本語版 7485
The Rust Programming Language 日本語版 まえがき はじめに 1. 事始め 1.1. インストール 1.2. Hello, ... る前に2つしかリクエストを受け付けないようにします。 ThreadPool に Drop トレイトを実装する スレッドプールに Drop を ... は動きません。 ファイル名: src/lib.rs impl Drop for ThreadPool { fn drop(&mut self) { for worker in &mut self.wor ... それを行います: ファイル名: src/lib.rs impl Drop for ThreadPool { fn drop(&mut self) { for worker in &mut self.wor ... るので、スレッドを終了しません。現在の drop の実装で ThreadPool をドロップしようとしたら、 最初のスレッドが完了する ...
https://man.plustar.jp/rust/book/ch20-03-graceful-shutdown-and-cleanup.html - [similar]
PREV 1 NEXT