Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallelizing arbitrary iterators #395

Closed
jrmuizel opened this issue Jul 7, 2017 · 4 comments
Closed

Parallelizing arbitrary iterators #395

jrmuizel opened this issue Jul 7, 2017 · 4 comments

Comments

@jrmuizel
Copy link

jrmuizel commented Jul 7, 2017

It would be nice to be able to parallelize programs like this:

    let f = File::open("foo.txt").unwrap();
    let f = BufReader::new(f);

    for line in f.lines().map(|x| something_very_expensive(x)) {
            println!("{}", line.unwrap());
    }

The assumption here is that something_very_expensive is expensive enough that we don't need to split the data into chunks larger than size 1.

@jrmuizel
Copy link
Author

This would help provide functionality similar to perl6's hyper() function.

@jrmuizel
Copy link
Author

It looks like https://github.com/TeXitoi/par-map provides this functionality

@bluss
Copy link
Contributor

bluss commented Jul 27, 2017

FYI this has been discussed in rayon before, for example in #297

@cuviper
Copy link
Member

cuviper commented Oct 17, 2017

Closing as a duplicate of #46.

@cuviper cuviper closed this as completed Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants