I'm using the SimpleQueue class from multiprocessing.queues. My program was working fine until I had an abnormal termination. Now whenever I run it, it freezes at a put call, before any get calls are performed. My guess is that SimpleQueue uses a file or something similar as the underlying method of communication and it got corrupted.
Any ideas on how I can get SimpleQueue to work again? Preferably without restarting the computer, it's a shared machine with multiple people working on it at the same time.
For me, SimpleQueue.put() seems to freeze when I make a lot of put calls, could that be the problem? (OS X, Anaconda, 2.7.10)
In [1]: from multiprocessing.queues import SimpleQueue
...: from time import time
...:
...: def put_jobs(n):
...: q = SimpleQueue()
...: t0 = time()
...: for i in xrange(n):
...: q.put((i, (42, 0)))
...: print '%.3f' % (time() - t0)
...:
In [6]: put_jobs(1000)
0.004
In [7]: put_jobs(1000)
0.004
In [8]: put_jobs(2000)
0.007
In [9]: put_jobs(3000)
0.010
In [10]: put_jobs(4000)
(not returning for minutes)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With