#thread #binary #operations #parallel #perform #vector #addition

bin+lib parallel_operations

A library to perform binary operations in parallel using threads

4 releases

0.1.4 Nov 19, 2024
0.1.2 Nov 19, 2024
0.1.1 Nov 18, 2024
0.1.0 Nov 18, 2024

#268 in Concurrency

Download history 376/week @ 2024-11-17 16/week @ 2024-11-24 2/week @ 2024-12-01 15/week @ 2024-12-08

409 downloads per month

MIT license

11KB
150 lines

Parallel Operations Library

This Rust library provides a set of parallel binary operations such as addition, multiplication, and more. The operations are designed to be computed concurrently using threads, leveraging the power of multiple CPU cores for faster performance.

Features

  • Perform binary operations (e.g., addition, multiplication) concurrently using threads.
  • Automatically adjusts the number of threads based on the available CPU cores.
  • Optimized for large datasets, ideal for high-performance computing.
  • Simple and flexible API to support any binary operation on vectors of numeric types.

Getting Started

To use the parallel_operations crate in your project, follow these steps:

cargo add parallel_operations
use parallel_operations::parallel_binary_operation;

fn main() {
    let data = vec![1, 2, 3, 4, 5];
    
    // Parallel addition
    let addition_result = parallel_binary_operation(data.clone(), |a, b| a + b);
    println!("Addition result: {}", addition_result);
}

Dependencies

~1.5MB
~27K SLoC