Threading Or Other Suggestions?!?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • andrea.gavana@agip.it

    #1

    Threading Or Other Suggestions?!?

    Hello NG,

    I have a wxPython application that does a lot of things. One of them,
    in particular, I have doubts on how to implement it. Essentially, this part
    of my application calls an external executable (an oil reservoir
    simulator). What I would like to do, is to give the user the possibility to
    run more than 1 simulation at the same time. This means:

    1) Writing the executable "data file" needed by the simulator
    2) Run the executable file (and wait until completion)
    3) Examine the simulation results

    For this, I was thinking about threads... does anyone have other/better
    suggestion(s)? Does anyone see any difficulty/memory problems in using
    threads?

    Thanks to you all for every suggestion.

    Andrea.

    ------------------------------------------------------------------------------------------------------------------------------------------
    Message for the recipient only, if received in error, please notify the
    sender and read http://www.eni.it/disclaimer/


  • Aahz

    #2
    Re: Threading Or Other Suggestions?!?

    In article <mailman.699.11 05699485.22381. python-list@python.org >,
    <andrea.gavana@ agip.it> wrote:[color=blue]
    >
    > I have a wxPython application that does a lot of things. One of them,
    >in particular, I have doubts on how to implement it. Essentially, this part
    >of my application calls an external executable (an oil reservoir
    >simulator). What I would like to do, is to give the user the possibility to
    >run more than 1 simulation at the same time. This means:
    >
    >1) Writing the executable "data file" needed by the simulator
    >2) Run the executable file (and wait until completion)
    >3) Examine the simulation results
    >
    >For this, I was thinking about threads... does anyone have other/better
    >suggestion(s )? Does anyone see any difficulty/memory problems in using
    >threads?[/color]

    If you're not on Windows, this will be much easier with multiple
    processes.
    --
    Aahz (aahz@pythoncra ft.com) <*> http://www.pythoncraft.com/

    "19. A language that doesn't affect the way you think about programming,
    is not worth knowing." --Alan Perlis

    Comment

    • chrisg

      #3
      Re: Threading Or Other Suggestions?!?

      You could also use os.spawnl to launch it in a separate process.

      Comment

      • Tim Roberts

        #4
        Re: Threading Or Other Suggestions?!?

        andrea.gavana@a gip.it wrote:[color=blue]
        >
        > I have a wxPython application that does a lot of things. One of them,
        >in particular, I have doubts on how to implement it. Essentially, this part
        >of my application calls an external executable (an oil reservoir
        >simulator). What I would like to do, is to give the user the possibility to
        >run more than 1 simulation at the same time. This means:
        >
        >1) Writing the executable "data file" needed by the simulator
        >2) Run the executable file (and wait until completion)
        >3) Examine the simulation results
        >
        >For this, I was thinking about threads... does anyone have other/better
        >suggestion(s )? Does anyone see any difficulty/memory problems in using
        >threads?[/color]

        Yes. Threads are used to run multiple parts of your own program. To run
        another program, you need to launch a new process.

        You can still monitor it.
        --
        - Tim Roberts, timr@probo.com
        Providenza & Boekelheide, Inc.

        Comment

        Working...