jinjagit / threadpool

A naive example of using a thread-pool in Rust.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

threadpool

My, rather naive, implementation (see main.rs) of Ryan Levicks's Rust threadpool library (see lib.rs), from his tutorial.

Learning to use Arc, Mutex, Atomic variables, and developing understanding of ownership, borrowing and closures.

compile to release version

Assuming you have Rust installed, compile to a release build to reveal actual performance differences from sharing the calculation between different numbers of threads:

  • clone repo.
  • $ cd threadpool
  • $ cargo build --release
  • $ cd target/release
  • $ ./main

example output

threadpool.png

About

A naive example of using a thread-pool in Rust.


Languages

Language:Rust 100.0%