nose icon indicating copy to clipboard operation
nose copied to clipboard

nosetests hangs with Queue + threading

Open sunqm opened this issue 7 years ago • 0 comments

A test code using Queue, threading with numpy hangs nosetests. The code looks like:

import numpy
from Queue import Queue
from threading import Thread

a = numpy.eye(100)
q = Queue()
def g(x):
    return a.dot(a) * x
def f(x):
    q.put(g(x))

t = Thread(target=f, args=(1,))
t.start()
t.join()
b = q.get()

sunqm avatar May 19 '17 22:05 sunqm