469,921 Members | 2,229 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,921 developers. It's quick & easy.

Difficult Python thread problem on AIX SMP machine


I am pretty new to python, so be gentle :)

I have a python script that spawns a number of threads (configurable) on a
12 processor AIX RISC-6000 machine. It works fine, so long as I am running
less than 5 threads. With more than 5, I get errors, but only on AIX, not
on Linux.

The python script is fairly simple, because each thread just spawns a korn
shell script. I actually get the error in the shell script, not in python,
but I think it may be python related, because I don't get the error when I
run the whole thing as a korn shell script.

Basically, each thread does:

pipe0_ = os.popen( 't.ksh 2>&1', 'r')
text0_ = pipe0_.read()
sts0_ = pipe0_.close()`

to spawn a shell script (t.ksh) that does:

cd subdir
ls -l
exit $?

There is a different subdir for each thread.

This works fine, so long as I am running less than 5 threads. But once I
run more than that, I start getting an error from the script:

sh: /home/gpomper/tmp/t8/thread.ksh: 0403-015 Cannot access a required
executable file. It is in use.

This problem only occurs on AIX. It runs fine on my Red Hat 9.0 machine.

I have tried to find what that AIX error means, with no luck. My problem
is made more difficult, because I try to simulate the error by writing a
korn shell script that basically does this:

t.ksh &
t.ksh &
t.ksh &
t.ksh &

repeated 20 times, and modify t.ksh so that it loops 100 time, so that I
can guarantee that all the processes are running simultaneously. When I
try this, I don't get the error.

Unfortunately, this makes AIX tech support think that this is a python
issue, not an AIX issue.

I would be *extremely* grateful for helpful suggestions.

- Gardner

Jul 18 '05 #1
0 2316

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

38 posts views Thread by Anthony Baxter | last post: by
118 posts views Thread by 63q2o4i02 | last post: by
28 posts views Thread by H J van Rooyen | last post: by
reply views Thread by Waqarahmed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.