Difficult Python thread problem on AIX SMP machine

Discussion in 'Python' started by Gardner Pomper, Nov 12, 2003.

  1. Hi,

    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
    Gardner Pomper, Nov 12, 2003
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
  2. Replies:
  3. Garry Hodgson
  4. ClownPleco

    putenv for AIX and ifdef for AIX

    ClownPleco, Aug 22, 2007, in forum: C Programming
    Thomas Dickey
    Aug 24, 2007
  5. Replies:
    Philippe Lucas
    Jul 8, 2005

Share This Page