I have a function call in python that looks like this:
from threading import Thread
while queue:
Thread(target=queue.extend, args=(longfunction(a, b))).start()
So I think the code above runs several queue.extend functions in parallel i.e it doesn't wait til the previous queue.extend has returned before starting the next queue.extend. But I'm not sure about the arguments.
My question is, does Python wait until longfunction(a, b) has finished evaluating and returned before it moves on to start a new thread, or is the whole thread started at once and then the next thread is started before longfunction has returned?
I'm a bit new to threads so please explain everything.