Re: Converting existing module/objects to threads

2006-10-19 Thread Hendrik van Rooyen
<[EMAIL PROTECTED]> wrote: > I have inheirted some existing code, that i will explain in a moment, > have needed to extend and ultimately should be able to run in threads. > I've done a bunch of work with python but very little with threads and > am looking for some pointers on how to implement, an

Re: Converting existing module/objects to threads

2006-10-19 Thread Jean-Paul Calderone
On Thu, 19 Oct 2006 14:09:11 -0300, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >At Thursday 19/10/2006 00:01, [EMAIL PROTECTED] wrote: >> > Consider using the asyncore module instead of threads. >> >>I think that is a good point and I am considering using >>asyncore/asynchat... i'm a little conf

Re: Converting existing module/objects to threads

2006-10-19 Thread Gabriel Genellina
At Thursday 19/10/2006 00:01, [EMAIL PROTECTED] wrote: > Consider using the asyncore module instead of threads. I think that is a good point and I am considering using asyncore/asynchat... i'm a little confused as to how i can make this model work. There is no server communication without con

Re: Converting existing module/objects to threads

2006-10-18 Thread John Henry
Making your code run in thread mode isn't the hard part. Just add this: import threading class subcontrollerThread(threading.Thread, subcontroller): def __init__(self,id,configurationFile): threading.Thread.__init__(self) subcontroller.__init__(self,id,co

Re: Converting existing module/objects to threads

2006-10-18 Thread martdi
I am not sure if I understand you question well, but: in the __init__ of the thread subclass, you can instantiate an object of the class that makes the work or ControllerThread could extend both classes and i don't think there would be a problem. Problems in multithreading usually happen whe

Re: Converting existing module/objects to threads

2006-10-18 Thread [EMAIL PROTECTED]
martdi wrote: > [EMAIL PROTECTED] wrote: > > I have inheirted some existing code, that i will explain in a moment, > > have needed to extend and ultimately should be able to run in threads. > > I've done a bunch of work with python but very little with threads and > > am looking for some pointers

Re: Converting existing module/objects to threads

2006-10-18 Thread [EMAIL PROTECTED]
Gabriel Genellina wrote: > At Wednesday 18/10/2006 22:02, [EMAIL PROTECTED] wrote: > > >This currently works in a non-threaded version, but only for one device > >at a time, there is a need to create a single windows(yeach) service > >that talks to many of these devices at once. I don't need work

Re: Converting existing module/objects to threads

2006-10-18 Thread martdi
[EMAIL PROTECTED] wrote: > I have inheirted some existing code, that i will explain in a moment, > have needed to extend and ultimately should be able to run in threads. > I've done a bunch of work with python but very little with threads and > am looking for some pointers on how to implement, and

Corner cases (was: Converting existing module/objects to threads)

2006-10-18 Thread Ben Finney
"[EMAIL PROTECTED]" <[EMAIL PROTECTED]> writes: > So an instance of a controller needs to be deadicated to a hardware > device forever, or until the program endswhich ever comes first. I hope you've got tests in place for both of those conditions :-) -- \ "How many people here have tel

Re: Converting existing module/objects to threads

2006-10-18 Thread Gabriel Genellina
At Wednesday 18/10/2006 22:02, [EMAIL PROTECTED] wrote: This currently works in a non-threaded version, but only for one device at a time, there is a need to create a single windows(yeach) service that talks to many of these devices at once. I don't need worker threads that handle seperate port

Converting existing module/objects to threads

2006-10-18 Thread [EMAIL PROTECTED]
I have inheirted some existing code, that i will explain in a moment, have needed to extend and ultimately should be able to run in threads. I've done a bunch of work with python but very little with threads and am looking for some pointers on how to implement, and if the lower level modules/object