Is it worth to write small library for Thread Pool Implementation?


During implementation of Networking application with MIO, I realized that I need concurrency with single threaded Network Event Loop, and using logic from Nginx implementation

  1. Event Loop Thread - Handle connection
  2. Event Loop Thread - Read data from connection
  3. Thread from Thread Pool - Handle data and process it
  4. Event Loop Thread - Return back to Event loop with concurrently parsed data

So for that purposes yesterday I made a library , and wanted to as is there anything else in Rust STD which can replace this implementation?



Well, there’s the threadpool crate but is there any reason you’re using MIO directly instead of Tokio (written on top of MIO)? If you’re willing to use Tokio, take a look at futures-cpupool.


Thanks for replay, I ended up using Tokio futures-cpupool :+1: