Threading madness

L

Lane LiaBraaten

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
 
S

Stephan Diehl

Lane said:
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).

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,170
Messages
2,570,927
Members
47,469
Latest member
benny001

Latest Threads

Top