Connecting Tech Pros Worldwide Forums | Help | Site Map

Threading madness

Lane LiaBraaten
Guest
 
Posts: n/a
#1: Jul 18 '05
I am developing a GUI that uses multiple threading.Threads, and Queue.Queues
for communicating between the threads, and threading.Timers for checking the
queues.

Everything works well (runs to completion and exits) on my RedHat7.3 machine,
but it doesn't work (hangs like some thread or queue is blocking)on RH9.
However, when I ssh into the RH9 box from my RH7.3 box, the app runs fine(on
my RH7.3 screen).

Now the madness sets in...if I compile the .py into a .pyc, and then run the
.pyc the app works fine on both machines.

So any ideas on what could be going on here?

Also, what is a good way to implement a repeating timer? e.g.:

import threading
myTimer=threading.Timer(10,foo)
myTimer.start()

def foo():
print "foo"
myTimer.start() --> Assertion, thread already started

I am currently reseting the timer like this:

def bar():
print bar
myTimer=threading.Timer(10,bar)
myTimer.start()

But isn't this a memory leak? What happens to the old myTimer?

TIA,
LGL


Stephan Diehl
Guest
 
Posts: n/a
#2: Jul 18 '05

re: Threading madness


Lane LiaBraaten wrote:
[color=blue]
> I am developing a GUI that uses multiple threading.Threads, and
> Queue.Queues for communicating between the threads, and threading.Timers
> for checking the queues.
>
> Everything works well (runs to completion and exits) on my RedHat7.3
> machine, but it doesn't work (hangs like some thread or queue is
> blocking)on RH9. However, when I ssh into the RH9 box from my RH7.3 box,
> the app runs fine (on my RH7.3 screen).[/color]

Apparently, RedHat 9.0 uses new threading model.
From what I've seen on several posts, there is a new environment variable
that forces the old threading behaviour:
LD_ASSUME_KERNEL=2.2.5

With that, you should be able to do a google search on the problem and see,
if this is related to your problem (I really have no idea if there is a
relation)

Stephan




Closed Thread