Return codes

Return codes

Post by Adisak Pochanay » Sat, 26 Jun 1993 23:44:39



   What is the easiest way to launch a program to run in parallel with you
and then wait until the other program finishes executing and get back a
return code from the program ?
 
 
 

Return codes

Post by Bjorn Ree » Wed, 30 Jun 1993 00:06:40



Quote:(Adisak Pochanayon) writes:
>    What is the easiest way to launch a program to run in parallel with you
> and then wait until the other program finishes executing and get back a
> return code from the program ?

If you launch a child from your program, I guess the easiest way to
get a return code is to have a common data area.

--


Odense University, Denmark     |     Voice: +45 65 932 182 (private)
          "There is no Childhood's end" - Marillion.

 
 
 

Return codes

Post by Tobias Rula » Wed, 30 Jun 1993 21:08:04




>(Adisak Pochanayon) writes:
>>    What is the easiest way to launch a program to run in parallel with you
>> and then wait until the other program finishes executing and get back a
>> return code from the program ?
>If you launch a child from your program, I guess the easiest way to
>get a return code is to have a common data area.

no!!!

if you want to get a return code from the other program you should
use the message/signal-system! if you use a common data area, the
waiting program has to test for the return code in a loop, like

_label      cmp.b  #return_code,memory_location
            bne    _label

or something like this. that costs much cpu-performance! instead install
a messageport and wait for the signal, then your task is put into
waiting state and does not take away cpu-time!

                   c u
                           tobias

---------------------------------------------------------------------------
Tobias Ruland, Dept. of Artificial Intelligence, University Erlan-

---------------------------------------------------------------------------

 
 
 

Return codes

Post by Bjorn Ree » Wed, 30 Jun 1993 23:48:06






> >(Adisak Pochanayon) writes:
> >>    What is the easiest way to launch a program to run in parallel with you
> >> and then wait until the other program finishes executing and get back a
> >> return code from the program ?

> >If you launch a child from your program, I guess the easiest way to
> >get a return code is to have a common data area.

> no!!!

> if you want to get a return code from the other program you should
> use the message/signal-system! if you use a common data area, the
> waiting program has to test for the return code in a loop, like

> _label      cmp.b  #return_code,memory_location
>             bne    _label

> or something like this. that costs much cpu-performance! instead install
> a messageport and wait for the signal, then your task is put into
> waiting state and does not take away cpu-time!

This is of course true. But it depends on what you want your main
program to do while the child is running. If you want it to do nothing
then signals are the best way (I didn't mention messages, as I believe
that a common data area is a better way to pass arguments.) If you on
the other hand want it to do something, then polling is the best (only?)
way.

--


Odense University, Denmark     |     Voice: +45 65 932 182 (private)
          "There is no Childhood's end" - Marillion.

 
 
 

1. How to read return code with Execute()

If I had a ARexx program looking something like this:

------
/* example.rx */
signal on failure

...

EXIT 0

failure:

EXIT 1
-------

And I executed it from my program with:

result=Execute("RX rexx:example.rx", 0, 0);

Then how could I read the return code? (the value of the EXIT argument)

Sander.

2. SBS 2K without a floppy

3. Help-Return Code Failed

4. 8mm video tapes for data storage

5. QUE: Examine() return code

6. Dired: setting highlight bar to follow cursor instead of mouse

7. lotus-note and sendmail

8. Fail Return Code & FailAt

9. Return Codes to CLI or SHELL's

10. Return codes

11. Return code Error#

12. Will not boot, checksum error, C: Assign failed return code 10 - A4000.