This is the mail archive of the frysk@sources.redhat.com mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: ForkedProcess (Was: Kill and refresh)


Mark Wielaard wrote:
Hi,

On Fri, 2006-07-14 at 14:49 +0200, Mark Wielaard wrote:
On Fri, 2006-07-14 at 14:17 +0200, Mark Wielaard wrote:
Yes, I actually have an addition to Fork which just gives you an
Input/OutputStream to the process to communicate with. I found that a
little more convenient then using signals. I'll post it to the list so
you can see if that is something we might want to add.
Here it is. I found it useful to write some quick tests which needed to
exchange information with the child process without needing to attach to
the process or send signals between frysk and the child process.
Two thoughts come to mind:

- we've a mechanism for communicating between frysk and a debug process using signals, rather than introducing custom mechanisms, can something based or following the existing technique be used?

- since it is only intended for testing and testing fork, can this live in TestLib - keeps frysk.sys's interfaces as close as possible to the underlying mechanism?

This code can't be plugged into frysk's event loop (I/O Stream can't be integrated into frysk.sys.Poll) so really isn't part of the core.

Andrew

2006-07-14 Mark Wielaard <mark@klomp.org>

        * Fork.java (ForkedProcess): New static inner class.
        (ForkedInputStream): Likewise.
        (ForkedOutputStream): Likewise.
        (ForkedProcess): New static method.
        * cni/Fork.cxx (fork): New method.
        (ForkedOutputStream::write): Likewise.
        (ForkedInputStream::read(void)): Likewise.
        (ForkedInputStream::read(jbyteArray,jint,jint)): Likewise.

At first I used Runtime.exec() for this, but since that spawns a new
Thread that tries to wait() on all processes that didn't work nicely
with the rest of frysk core.

Would it make sense to add this new functionality to Fork?

Since I am using this for writing new tests I would like it to be added. OK?

Cheers,

Mark



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]