Hi all,
I try to use IDLE for debugging my multithreading python application.
In my application i have the following class:
class DataMonitor( threading.Thread ):
'''Updates data with regular frequency'''
_update_frequency_in_sec = 0.5
def __init__ ( self, update_funcs, data ):
threading.Thread.__init__( self )
self._update_funcs = update_funcs
self._data = data
self._keep_running = True
def run(self):
'''Start data monitoring'''
while self._keep_running:
self._update_data()
print "i'm running"
time.sleep( self._update_frequency_in_sec )
An object of this class is created from the main thread and is stored there.
When i set breakpoints in the code that is executed in the main thread, they
are reached with no problems.
When i set breakpoints in the while loop of the run() method of my thread
class DataMonitor (at the line with print statement), the breakpoint is
never reached. However, the application keeps running and i get a lot of
"i'm running" messages in the python shell of IDLE.
My configuration:
SunOS wsasd179 5.8 Generic_117350-18 sun4u sparc SUNW,Sun-Blade-1500
Python 2.5.1 (r251:54863, Aug 6 2008, 14:27:55)
[GCC 3.4.3] on sunos5
Thanks for any help on my problem!
Regards, DimaS
--- Begin Message ---
Hi all,
I try to use IDLE for debugging my multithreading python application.
In my application i have the following class:
class DataMonitor( threading.Thread ):
'''Updates data with regular frequency'''
_update_frequency_in_sec = 0.5
def __init__ ( self, update_funcs, data ):
threading.Thread.__init__( self )
self._update_funcs = update_funcs
self._data = data
self._keep_running = True
def run(self):
'''Start data monitoring'''
while self._keep_running:
self._update_data()
print "i'm running"
time.sleep( self._update_frequency_in_sec )
An object of this class is created from the main thread and is stored there.
When i set breakpoints in the code that is executed in the main thread, they
are reached with no problems.
When i set breakpoints in the while loop of the run() method of my thread
class DataMonitor (at the line with print statement), the breakpoint is
never reached. However, the application keeps running and i get a lot of
"i'm running" messages in the python shell of IDLE.
My configuration:
SunOS wsasd179 5.8 Generic_117350-18 sun4u sparc SUNW,Sun-Blade-1500
Python 2.5.1 (r251:54863, Aug 6 2008, 14:27:55)
[GCC 3.4.3] on sunos5
Thanks for any help on my problem!
Regards, DimaS
--- End Message ---
_______________________________________________
IDLE-dev mailing list
IDLE-dev@python.org
http://mail.python.org/mailman/listinfo/idle-dev