Interprocess Communication, multiple threads
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   John_Resler
Posted On:   Monday, January 27, 2003 09:04 AM

How do I run a native application and manage it's I/O? I have a group of Ada95 executables that for technical reasons cannot be modified. I am writing a User Interface for these applications that will execute the applications. I would like to find some literature discussing the best way to do this. I have read that multiple threads, one for reading OutputStreams, one for reading ErrorStreams and one for reading InputStreams is a good way to go. The java api's indicate that command prompt applications (dos/win16) may not work well with Runtime.exec() calls because the io buffers are intended to run with the dos prompt and this can cause problems. I also am a little confused about obtai   More>>

How do I run a native application and manage it's I/O?


I have a group of Ada95 executables that for technical reasons cannot be modified.
I am writing a User Interface for these applications that will execute the applications.
I would like to find some literature discussing the best way to do this. I have read that
multiple threads, one for reading OutputStreams, one for reading ErrorStreams and one
for reading InputStreams is a good way to go. The java api's indicate that command prompt
applications (dos/win16) may not work well with Runtime.exec() calls because the io buffers
are intended to run with the dos prompt and this can cause problems. I also am a little
confused about obtaining the child processes' IO.



Because the class Process is abstract, the only way (in this case) i can create a copy of

it is to use a statement like the following:

			
java.lang.Process child = Runtime.exec("other_executable");
OutputStream os = child.getOutputStream();
OutputStream es = child.getErrorStream();
InputStream is = child.getInputStream();


If I cannot get the child process io until it has already been executed and the internal

buffers may not support much storage, how do I safely collect all the io from the child process?

Your help is greatly appreciated.


   <<Less
About | Sitemap | Contact