how to terminate an external program after timeout?

Christian Maeder Christian.Maeder at dfki.de
Thu Sep 9 12:18:59 EDT 2010


David Peixotto schrieb:
> On Sep 9, 2010, at 6:37 AM, Simon Marlow wrote:
> 
>> On 09/09/2010 10:39, Christian Maeder wrote:
>>> Christian Maeder schrieb:
>>>> Hi,
>>>>
>>>> we call from our haskell application the metis prover via
>>>>
>>>>  System.Process.readProcessWithExitCode "metis" filename ""
>>>>
>>>> However, we are not able to get rid of this process if metis does not
>>>> terminate by itself. In particular, wrapping this call into a
>>>> System.Timeout.timeout does not work.
>>> timeout works so far as it is possible to start another action, but the
>>> continuing metis process still blocks the whole system.
>>>
>>> C.
>>>
>>>> Any suggestions how we should handle this ideally portably but first of
>>>> all under unix. (ghc-6.12.3)
>> Take a look at the timeout program in GHC's test suite:
>>
>> http://darcs.haskell.org/testsuite/timeout/timeout.hs

This looks pretty complicated. Did no one else needed this? Isn't it
easier to put the application into a wrapper script and call the script
from haskell?

> In case it's not obvious, I believe this has to be compiled with -threaded to get the desired behavior.
> 
> -David

Yes, we do use -threaded.

Christian


More information about the Glasgow-haskell-users mailing list