Hi,

I’am relatively new to rust. What really catch my attention is the “threads without data races” features so i thought let try this new beast .

Recently i saw the “Sieve of Eratosthenes” algorithm which computes a bunch of prime numbers written in C++ and TBB and i thought it would be good to compare rust against it.

I have wrote the sequential version of the algorithm in rust but i don’t know how to parallelize it.

Sequential version:

```
fn sieve_of_eratosthenes(n: i32) {
let mut vec = vec![1; (n+1) as usize];
let mut i: i32 = 2;
while i*i <= n
{
if vec[i as usize] == 1
{
//parallelize this while loop
let mut j = 2*i;
while j < n {
vec[j as usize] = 0;
j += i;
}
}
i+=1;
}
}
```

To stay close to the C++ TBB library i tried the simple_parallel library.

Example from simple_parallel docs:

```
simple_parallel::for_(data.iter_mut().enumerate(), |(i, elem)| {
*elem = i as i32;
});
```

But i could not find any possibility to set the start value and the step size in the parallel for loop which i need for this problem.

Can anyone help me?