Hi, please tell me how to use different functions in different threads using the thread pool in twisted ... say
I have a list of identifiers x=[1,2,3,4], where 1,2, ... etc. are identifiers (I got from the database, and each of them contains a python script in some place on the disk).
what i want to do is
scanning x traverses in the list and running each script in different threads until they end
Thanx Calderone, your code helped me a lot.
I have little doubt that I can resize the threadpool this way.
from twisted.internet import reactor
reactor.suggestThreadPoolSize(30)
They say that all 30 available threads are busy, and there are still identifiers in the list (dict or tuple) 1 - In this situation, will all identifiers pass? I mean, as soon as the thread becomes free, the next tool (id) will be assigned to the freed thread? 2 - there are also some cases when one tool must be executed before the second tool, and one output of the tool will be used by another tool, as it will be controlled in a twisted thread. 3
source
share