#thread-pool #worker #worker-thread #jobs #execute #trace #send

rahat3062_pool

A simple, efficient thread pool for Rust.❤️

1 unstable release

0.1.0 May 4, 2024

#38 in #worker-thread

MIT license

10KB
113 lines

ThreadPool

A simple, efficient thread pool for Rust.

Overview

This crate provides a ThreadPool struct that allows you to execute jobs on a pool of worker threads. It's useful for offloading CPU-intensive or blocking I/O tasks to a separate set of threads, to avoid blocking the main thread of your application.

Features

  • Easy to use: Just create a ThreadPool and start adding jobs.
  • Efficient: Workers are reused for multiple jobs, reducing the overhead of thread creation.
  • Safe: Jobs are Send and 'static, ensuring they can safely be sent across threads.
  • Traceable: Enable the trace flag to print the states of the workers.

License

This project is licensed under the MIT License.

No runtime deps