Loading ...
Sorry, an error occurred while loading the content.

timeouts?

Expand Messages
  • Hendrik Boom
    I have inherited a program containing: printf nrun: %s n c; let exitcode = Sys.command c in if exitcode = 0 then loop cs else exitcode Is there any way to
    Message 1 of 3 , Feb 27, 2013
    • 0 Attachment
      I have inherited a program containing:

      printf "\nrun: %s \n" c;
      let exitcode = Sys.command c in
      if exitcode = 0 then
      loop cs'
      else
      exitcode

      Is there any way to limit the time that the command c has to run and kill it
      if it takes too long?

      -- hendrik
    • Francois Berenger
      ... I guess Async from Janestreet would have such functionalities (I never used personally). I have seen Input/output with timeout in:
      Message 2 of 3 , Feb 27, 2013
      • 0 Attachment
        On 02/28/2013 04:32 AM, Hendrik Boom wrote:
        > I have inherited a program containing:
        >
        > printf "\nrun: %s \n" c;
        > let exitcode = Sys.command c in
        > if exitcode = 0 then
        > loop cs'
        > else
        > exitcode
        >
        > Is there any way to limit the time that the command c has to run and kill it
        > if it takes too long?

        I guess Async from Janestreet would have such functionalities (I never
        used personally).

        I have seen Input/output with timeout in:
        http://caml.inria.fr/pub/docs/manual-ocaml/libref/ThreadUnix.html

        > -- hendrik
        >
        >
      • Sébastien Dailly
        ... The same discussion came recently on [1]ocaml ml, wich ended with a mantis [2]ticket creation. For sum up : there is no way for doing this in a portable
        Message 3 of 3 , Feb 28, 2013
        • 0 Attachment
          Le 28/02/2013 01:58, Francois Berenger a écrit :
          > On 02/28/2013 04:32 AM, Hendrik Boom wrote:
          > > I have inherited a program containing:
          > >
          > > printf "\nrun: %s \n" c;
          > > let exitcode = Sys.command c in
          > > if exitcode = 0 then
          > > loop cs'
          > > else
          > > exitcode
          > >
          > > Is there any way to limit the time that the command c has to run and
          > kill it
          > > if it takes too long?
          >
          > I guess Async from Janestreet would have such functionalities (I never
          > used personally).
          >
          > I have seen Input/output with timeout in:
          > http://caml.inria.fr/pub/docs/manual-ocaml/libref/ThreadUnix.html
          >

          The same discussion came recently on [1]ocaml ml, wich ended with a
          mantis [2]ticket creation.

          For sum up : there is no way for doing this in a portable way (includind
          the windows platform), so there is no evolution planned for that.

          [1] https://sympa.inria.fr/sympa/arc/caml-list/2013-01/msg00164.html
          [2] http://caml.inria.fr/mantis/view.php?id=5908

          --
          Sébastien
        Your message has been successfully submitted and would be delivered to recipients shortly.