
September 13th, 2002, 03:35 AM
|
|
Junior Member
|
|
Join Date: Sep 2002
Posts: 0
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
concurrent programming - design problem
Hi!
I have a problem in my project I startet a few weeks ago. The requirement is to develop 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
do something else
while ...
...
PAREND
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())
But how can this be executed concurrent? Is there another possibility in Python?
thx
|