AW: [Twisted-Python] threads monitoring
Well, I'm not at the keyboard, but you'll probably need to take a look at the source code which threadpool instance is used by deferToThread. Andreas -- Ursprüngl. Mitteil. -- Betreff: [Twisted-Python] threads monitoring Von: Ladislav Andel <ladaan@iptel.org> Datum: 15.08.2007 16:53 Hello, How can I monitor the number of created threads when I use just function deferToThreds in my code? Could you give me an example, please? If I do following: ThreadPool.dumpStats() I get TypeError: unbound method dumpStats() must be called with ThreadPool instance as first argument (got nothing instead) Here I understand I have to make an instance of ThreadPool, but if I just use deferToThreads from threads module I'm not sure how to accomplish it. Thanks, Ladislav _______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
As I could see there are 2 approaches. 1) deferToThread which calls callInThread method and reactor takes care of threads 2) or I can create an instance of ThreadPool and manage threads manually where I have to care of dispatching request if I'm not mistaken. So here it is but is there any answer to my original question? Lada Andreas Kostyrka wrote:
Well, I'm not at the keyboard, but you'll probably need to take a look at the source code which threadpool instance is used by deferToThread.
Andreas
-- Ursprüngl. Mitteil. -- Betreff: [Twisted-Python] threads monitoring Von: Ladislav Andel <ladaan@iptel.org> Datum: 15.08.2007 16:53
Hello, How can I monitor the number of created threads when I use just function deferToThreds in my code?
Could you give me an example, please?
If I do following: ThreadPool.dumpStats()
I get
TypeError: unbound method dumpStats() must be called with ThreadPool instance as first argument (got nothing instead)
Here I understand I have to make an instance of ThreadPool, but if I just use deferToThreads from threads module I'm not sure how to accomplish it.
Thanks, Ladislav
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
_______________________________________________ Twisted-Python mailing list Twisted-Python@twistedmatrix.com http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python
participants (2)
-
Andreas Kostyrka
-
Ladislav Andel