concurrent programming

Cameron Laird claird at starbase.neosoft.com
Fri Sep 13 14:58:37 CEST 2002


In article <fe31142f.0209130052.33174fcc at posting.google.com>,
Chris <cs26 at tecco.at> wrote:
>Hi!
>
>I have a problem in my project I startet a few weeks ago. The
>requirement is to program a Task Scheduler who gets a Python script
>with the tasks spezified. So I have to write some extensions in C++
>which provide the functionality. So far so good, now comes the
>problem. It should be possible to write something like:
><code>
>PARBEGIN
>    if ....
>        exeute some shell scripts on distributed computers
>        some method calls from the extension module, e.g. write in a
>database
>    do something else
>    while ...
>    ...
>PAREND
></code>
>
>This means that the code bracketed in PARBEGIN PAREND should be
>executed parallel. The contrary would be SEQBEGIN SEQEND for
>sequential execution.
>
>The Task Scheduler is for testing some programs, so the scripts should
>be easy to write and not too complicated. My idea would be to handle
>this with a call of a function from the extension module which gets a
>function pointer to a method with the code inside PARBEGIN PAREND as a
>parameter, so that I can do a callback from the C++ module e.g.:
><code>
>def f():
>    if ....
>        exeute some shell scripts on distributed computers
>        some method calls from the extension module, e.g. write in a
>database
>    do something else
>    while ...
>    ...
>
>exec_par(f())
></code>
>
>But how can this be executed concurrent? Is there another possibility
>in Python?
>
>thx

There are several possibilities for styling concurrent
processing in Python.

Why are we talking about C++, though?  Would a pure-Python
solution not meet your requirements?
-- 

Cameron Laird <Cameron at Lairds.com>
Business:  http://www.Phaseit.net
Personal:  http://phaseit.net/claird/home.html



More information about the Python-list mailing list