Re: Counting Threads

2005-10-29 Thread David Poundall
After much optimisation it turns out the following code does the job for me. In the end using count didn't give me the flexibility I needed. Instead I now name each thread and track them accordingly. It's arguable if I need the thread locking now though, however I have left it in to remind me of

Re: Counting Threads

2005-10-28 Thread David Poundall
Sorry Denis - but could you give me an example. I can't for the life of me see how the syntax for that would go. -- http://mail.python.org/mailman/listinfo/python-list

Re: Counting Threads

2005-10-27 Thread David Poundall
First time I have used thread locking. This seems to work but is it correct? from threading import Thread, Event, Lock . . . def launch(self, ThreadTitle, SubToLaunch, SubsArgs=(), SubsKwargs={}, AsDaemon=True): my_lock = Lock() my_lock.acquire() try: # ---

Re: Counting Threads

2005-10-27 Thread David Poundall
>> But the count isn't doint what I expected. I was after a increment >> after every time the class was used ireespective of instance. >I have no idea what that last sentence above means... On re-reading it - neither do I. Sorry about that. What I meant to say was that I was after an incremen

Re: Counting Threads

2005-10-27 Thread Peter Hansen
David Poundall wrote: > Just sorted (its always the way when you post isn't it) > > But the count isn't doint what I expected. I was after a increment > after every time the class was used ireespective of instance. I have no idea what that last sentence above means... > Instead > I get a coun

Re: Counting Threads

2005-10-27 Thread David Poundall
Just sorted (its always the way when you post isn't it) But the count isn't doint what I expected. I was after a increment after every time the class was used ireespective of instance. Instead I get a count based on the instance usage. Idea's anyone? # -

Re: Counting Threads

2005-10-27 Thread David Poundall
Just sorted (its always the way when you post isn't it) But the count isn't doint what I expected. I was after a increment after every time the class was used ireespective of instance. Instead I get a count based on the instance usage. Idea's anyone? # -

Counting Threads

2005-10-27 Thread David Poundall
I have a thread class and I want to be able to track its usage within an application. FYI the class launches aplications in their own thread when the 'launch' method is called. That works OK However I want to take things a bit further and my thinking was that I could use a class parameter to do