Using multithreading and queues for speed increase#110
Merged
KingAkeem merged 5 commits intoDedSecInside:devfrom Aug 8, 2018
KingAkeem:prestarting_threads
Merged
Using multithreading and queues for speed increase#110KingAkeem merged 5 commits intoDedSecInside:devfrom KingAkeem:prestarting_threads
KingAkeem merged 5 commits intoDedSecInside:devfrom
KingAkeem:prestarting_threads
Conversation
areas. Added Daemon threads back to remove hanging if blocking occurs once the rest of the program has terminated
Member
|
@KingAkeem is there any mechanism to provide the no of threads? like -t 100 ? |
Member
Author
|
@PSNAppz No the user shouldn't be allowed to select the number of threads, it's directly based off the amount of work needed to be done. It's optimal for the algorithm. |
Member
|
@KingAkeem I think that feature would be a plus. |
Member
Author
|
It wouldn't work well due to Python's threading scheme. If someone were to pass 1 thread then it would completely destroy the algorithm. The queue needs a certain amount of space to run efficiently. It makes much more sense to base it off the amount of work necessary and it makes the function much more flexible and able to be used as an API instead. |
PSNAppz
approved these changes
Aug 8, 2018
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Proposed
Explanation of Changes
Threads are pre-spawned and jobs are managed using a queue in order to avoid race conflicts.