[erlang-questions] : Kill a process tree

Mats Cronqvist mats.cronqvist@REDACTED
Tue Apr 24 10:22:43 CEST 2007


June Kim wrote:
> >> 2007/4/22, June Kim <juneaftn@REDACTED>:
>>>> My original purpose of all this is, to make a test runner, which runs
>>>> a given function, which in turn might create a group of
>>>> processes(which may not be linked to each other) and then kill all of
>>>> them after a certain amount of time. The function under test could be
>>>> written without the specific consideration of being run with the test
>>>> runner.

> I think I have to consider Ulf's advice: trace.


   maybe i'm missing something, but it seems all you want is to kill all 
processes that were created while running the test case.

   that can of course be easily accomplished by this pseudo-code;

PreProc = processes(),
run_test_case()
PostProc = processes(),
[exit(P,kill) || P <- PostProc--PreProc].

   mats



More information about the erlang-questions mailing list