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

Use sync_channel to limit the size of job queue? #95

Open
lotabout opened this issue Apr 10, 2018 · 3 comments
Open

Use sync_channel to limit the size of job queue? #95

lotabout opened this issue Apr 10, 2018 · 3 comments
Labels
2.0 Currently planed for 2.0
Projects

Comments

@lotabout
Copy link

rust-threadpool use channel for receiving jobs, that means if the number of jobs is very large it will consume lots of memory.

So I'd like to know if it is a good idea or not to use sync_channel instead of sync.

I googled and found:

Not sure why the author hadn't submitted a PR.

@dns2utf8 dns2utf8 added this to To do in 2.0 Dec 18, 2019
@dns2utf8
Copy link
Member

Thank you for bringing this to my attention. It influenced the design for 2.0.

@dns2utf8 dns2utf8 added the 2.0 Currently planed for 2.0 label Dec 18, 2019
@dns2utf8
Copy link
Member

Hi you can test it in the 2.0 branch now. If you have feedback, I am happy to listen.
Cheers,
Stefan

@lotabout
Copy link
Author

Hi you can test it in the 2.0 branch now. If you have feedback, I am happy to listen. Cheers, Stefan

Play around 2.0's queue_size and it works like a charm.

However I notices that the queue is unbounded by default. Not sure if it's a good idea to put a default limit on it, say num_of_worker * some_default_ratio.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 Currently planed for 2.0
Projects
2.0
  
To do
Development

No branches or pull requests

2 participants