Can a process update a shared queue while threads consume the queue?
<p>I'm trying to create a multithreaded hash cracker/bruteforcer in Python and I'm encountering an issue when having a thread generate all possible word combinations and put them on a queue while having 10 other threads hash the queue. The issue is that the 10 hashing threads hog execution time from the 1 thread generator, bottlenecking it. So my question is this: Is it possible to have a process update a queue that can be used by other threads concurrently in Python?</p>

<p>The <a href="https://docs.python.org/2/library/multiprocessing.html#multiprocessing.Queue" rel="nofollow">multiprocessing.Queue</a> object is process and thread safe.</p>

<p>I'd let the main loop of your solution populate the Queue while multiple processes hash its content.</p>

<p>As you work seems to be CPU bound, I'd avoid threads. </p>

python multithreading concurrency multiprocessing