-
Notifications
You must be signed in to change notification settings - Fork 36
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
Configurable threads #39
base: master
Are you sure you want to change the base?
Conversation
Hi, I'm currently resolving the merge conflicts while also trying to improve the code a bit further. Could you explain why this is necessary? What is this check for? To me it looks like it doesn't do anything.
|
You are also never removing anything from the
This code never gets executed because of that. |
Ah, my mistake. I can clean up that process list logic. So from what I remember p.join() will wait for the process to exit and will clean up resources if the process has exited. I think (or thought) that without this the child process may exit but still exist until it was "joined" back into the main thread. But that could have been a misunderstanding, ill have to fact check that. I'm also using it to pause the main thread so it doesnt burn up too many cpu cycles looping too quickly. Let me know what else you think should be done differently or cleaned up and i can either fix it in this pr or submit another if you'd like. |
The logic with the Other than that I resolved the merge conflicts and improved the code a bit. |
I added a lot between commits, which was a mistake, but the rundown is that I re-worked the threaded downloads.
Previously each 4chan thread would get its own process to check and download new images.
I created a queue (manager.list) system and made static workers/processes. By default, 4 will be created, but that is configurable with -p. As 'jobs' are pulled from the queue, a worker thread will work on it, then wait until another job is available to pull from the queue.
Let me know if you have any questions or want me to change anything.
Thanks!