comp.lang.ada
 help / color / mirror / Atom feed
From: "Rick Stikkers" <rstikkers@telis.org>
Subject: Re: Spawning a subprocess and communicating with it.
Date: 1998/10/02
Date: 1998-10-02T00:00:00+00:00	[thread overview]
Message-ID: <6v41hn$b90$1@mentor.telis.org> (raw)
In-Reply-To: F3740247C2BED111A0AE00805FEA9C92017FFD15@pwflml02.pwfl.com

    As far as starting another program within your program, that is
relatively easy.  Look up unix.exec and that should give you a pretty good
start.  When it comes to communicating between these processes, things
become a little more difficult.
    The programs are going to have to talk back and forth on sockets.  As
long as you just plan on talking between these two processes, it is
relatively easy.  If you plan on adding more processes in the future,
though, I would suggest writing a message router.  Socket communications can
either be done through C routines as we use at my company, or through use of
C pragmas.  Either way, you are going to have to rely heavily on C code.
Although I am not allowed to release source code done for work, I did find
some source that looks like it will work at
http://www.cs.fsu.edu/~baker/cen4010.S97/ada/sockets/gnatsocks/
Good luck in this journey.  It is not an easy road.

    Rick

Condic, Marin D. wrote in message ...
>    I'm looking for an example of how I might accomplish the following
>    using SunOS 5.5.1 Unix and GNAT 3.9 (or later):
>
>    I want to write an Ada program that can start up another Ada
>    program as a subprocess, coprocess or whatever is the common Unix
>    paradigm. (I just need it running as a separate, stand-alone
>    executable image whose execution need go on no longer than that of
>    the parent program that initiated it.) When the subprocess is up
>    and running, I need to trade messages back and forth (character
>    strings are sufficient) between the two processes.
>
>    I presume this is all doable through various Unix system calls,
>    but unfortunately, we don't seem to have anyone around here who is
>    much of an expert on Unix calls, or how to interface to them via
>    Ada or even any manuals one might peruse on the subject. If
>    someone could send me a small example of how this is done, I would
>    be grateful. Thanks.
>
>    MDC
>Marin D. Condic
>Real Time & Embedded Systems
>Pratt & Whitney,
>Government Engines & Space Propulsion
>M/S 731-95, P.O.B. 109600,
>West Palm Beach, FL, 33410-9600
>Ph: 561.796.8997         Fx: 561.796.4669
>
>"The speed with which people can change a courtesy into an entitlement is
>awe-inspiring."
>        --  Miss Manners, February 8, 1994






  reply	other threads:[~1998-10-02  0:00 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-10-01  0:00 Spawning a subprocess and communicating with it Condic, Marin D.
1998-10-02  0:00 ` Rick Stikkers [this message]
1998-10-02  0:00 ` dennison
1998-10-05  0:00 ` John McCabe
1998-10-12  0:00 ` Tom Moran
  -- strict thread matches above, loose matches on Subject: below --
1998-10-05  0:00 Condic, Marin D.
1998-10-06  0:00 ` Robert L. Spooner
1998-10-06  0:00 ` dennison
1998-10-07  0:00 ` Jerry van Dijk
1998-10-07  0:00 ` John McCabe
1998-10-08  0:00   ` dennison
1998-10-07  0:00 Condic, Marin D.
1998-10-08  0:00 ` dennison
1998-10-08  0:00 ` Jerry van Dijk
1998-10-08  0:00 ` dennison
1998-10-08  0:00 Condic, Marin D.
1998-10-09  0:00 ` alan walkington
1998-10-09  0:00 Condic, Marin D.
1998-10-13  0:00 ` Robert I. Eachus
1998-10-09  0:00 Condic, Marin D.
1998-10-12  0:00 Condic, Marin D.
1998-10-13  0:00 ` Pascal Obry
1998-10-13  0:00 Condic, Marin D.
1998-10-13  0:00 ` Scott Ingram
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox