Home > Archive > Tcl > June 2006 > Should I use fork, or is there a simpler way?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Should I use fork, or is there a simpler way?
|
|
| sarmstro 2006-06-24, 8:23 am |
| I'm doing some testing on a system here where I want to kick off a
range of tests written in Expect, and in parallel, repeatedly run a
simple app which will check the memory usage of each process on the
system, with an arbitrary time interval between each check.
I'd like the outputs of the memory checks written to a file, and so
have it completely running in the background, where the scripts running
the range of tests happen in the foreground. Is fork the way to go
about this, and if so, how does the background process know when the
foreground tests have finished so that it can exit gracefully. Is there
another way of doing this just by using multiple spawn_ids and running
one in the background, so that the foreground tests don't pause while
the memory checks are happening?
Thanks,
Scott
| |
| sarmstro 2006-06-28, 7:03 pm |
| To do this without fork would be great, but I'm stumped on how to kick
off a spawn and have it perform some function every, say, 5 minutes,
without pausing or interfering with the main test script which is
running in another spawned process.
Thanks for the reply,
Scott
Jeff Hobbs wrote:
> sarmstro wrote:
>
> If you are using Expect, then you can't use threads. That doesn't
> matter in this case though, as you should be able to do this all in one
> thread by controlling multiple spawned programs. If you code it up
> right, you can just cycle through and see which spawned process (my
> guess is one per machine) is reporting back.
>
> IOW, you should be able to do this without fork.
>
> Jeff
| |
| Cameron Laird 2006-06-28, 7:03 pm |
| In article <1151493161.991539.300960@j72g2000cwa.googlegroups.com>,
sarmstro <z_glip@hotmail.com> wrote:
>To do this without fork would be great, but I'm stumped on how to kick
>off a spawn and have it perform some function every, say, 5 minutes,
>without pausing or interfering with the main test script which is
>running in another spawned process.
|
|
|
|
|