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

Re: "ocaml_beginners"::[] Will Unix.wait stop a processor's threads?

Expand Messages
  • rixed@happyleptic.org
    ... Then wait() being a blocking syscall this is not surprising that your OCaml process can t receive anything during the wait().
    Message 1 of 9 , Jun 17, 2010
    • 0 Attachment
      > > Or maybe you are using the VM based implementation for threads ?
      >
      > I am. But I am assuming that the behaviour of both is similar.

      Then wait() being a blocking syscall this is not surprising
      that your OCaml process can't receive anything during the wait().
    • Hugo Ferreira
      ... It can. While one thread blocks on in/out the others work. Blocking on wait does seem to allow other threads to work. This in the vm. Should be the same
      Message 2 of 9 , Jun 17, 2010
      • 0 Attachment
        rixed@... wrote:
        >>> Or maybe you are using the VM based implementation for threads ?
        >> I am. But I am assuming that the behaviour of both is similar.
        >
        > Then wait() being a blocking syscall this is not surprising
        > that your OCaml process can't receive anything during the wait().
        >

        It can. While one thread blocks on in/out the others work.
        Blocking on wait does seem to allow other threads to work.
        This in the vm. Should be the same for opt.


        >
        >
        > ------------------------------------
        >
        > Archives up to December 31, 2009 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
        > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
        > Attachments are banned and you're asked to be polite, avoid flames etc.Yahoo! Groups Links
        >
        >
        >
      • rixed@happyleptic.org
        -[ Thu, Jun 17, 2010 at 02:40:11PM +0100, Hugo Ferreira ]---- ... Are you certain you are using the VM implementation of threads ? Ie are you compiling with
        Message 3 of 9 , Jun 17, 2010
        • 0 Attachment
          -[ Thu, Jun 17, 2010 at 02:40:11PM +0100, Hugo Ferreira ]----
          > rixed@... wrote:
          > >>> Or maybe you are using the VM based implementation for threads ?
          > >> I am. But I am assuming that the behaviour of both is similar.
          > >
          > > Then wait() being a blocking syscall this is not surprising
          > > that your OCaml process can't receive anything during the wait().
          >
          > It can. While one thread blocks on in/out the others work.
          > Blocking on wait does seem to allow other threads to work.
          > This in the vm. Should be the same for opt.

          Are you certain you are using the VM implementation of threads ?
          Ie are you compiling with -thread or -vmthread ?
        • Hugo Ferreira
          ... Fairly certain. I am using ocamlbuild and generating the application with the *.d.byte extension.
          Message 4 of 9 , Jun 17, 2010
          • 0 Attachment
            rixed@... wrote:
            > -[ Thu, Jun 17, 2010 at 02:40:11PM +0100, Hugo Ferreira ]----
            >> rixed@... wrote:
            >>>>> Or maybe you are using the VM based implementation for threads ?
            >>>> I am. But I am assuming that the behaviour of both is similar.
            >>> Then wait() being a blocking syscall this is not surprising
            >>> that your OCaml process can't receive anything during the wait().
            >> It can. While one thread blocks on in/out the others work.
            >> Blocking on wait does seem to allow other threads to work.
            >> This in the vm. Should be the same for opt.
            >
            > Are you certain you are using the VM implementation of threads ?
            > Ie are you compiling with -thread or -vmthread ?
            >

            Fairly certain. I am using ocamlbuild and generating the
            application with the *.d.byte extension.

            >
            >
            >
            > ------------------------------------
            >
            > Archives up to December 31, 2009 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
            > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
            > Attachments are banned and you're asked to be polite, avoid flames etc.Yahoo! Groups Links
            >
            >
            >
          • rixed@happyleptic.org
            -[ Thu, Jun 17, 2010 at 05:41:03PM +0100, Hugo Ferreira ]---- ... You probably use the pthread implementation. Byte code programs can use both.
            Message 5 of 9 , Jun 17, 2010
            • 0 Attachment
              -[ Thu, Jun 17, 2010 at 05:41:03PM +0100, Hugo Ferreira ]----
              > > Are you certain you are using the VM implementation of threads ?
              > > Ie are you compiling with -thread or -vmthread ?
              > >
              >
              > Fairly certain. I am using ocamlbuild and generating the
              > application with the *.d.byte extension.

              You probably use the pthread implementation. Byte code programs can
              use both.
            • Hugo Ferreira
              ... Ok. I stand corrected. Looking at the ocamlbuild file I see the use of -thread flag and threads.cma library.
              Message 6 of 9 , Jun 18, 2010
              • 0 Attachment
                rixed@... wrote:
                > -[ Thu, Jun 17, 2010 at 05:41:03PM +0100, Hugo Ferreira ]----
                >>> Are you certain you are using the VM implementation of threads ?
                >>> Ie are you compiling with -thread or -vmthread ?
                >>>
                >> Fairly certain. I am using ocamlbuild and generating the
                >> application with the *.d.byte extension.
                >
                > You probably use the pthread implementation. Byte code programs can
                > use both.
                >

                Ok. I stand corrected. Looking at the ocamlbuild file I
                see the use of -thread flag and threads.cma library.


                >
                >
                > ------------------------------------
                >
                > Archives up to December 31, 2009 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
                > The archives of the very official ocaml list (the seniors' one) can be found at http://caml.inria.fr
                > Attachments are banned and you're asked to be polite, avoid flames etc.Yahoo! Groups Links
                >
                >
                >
              Your message has been successfully submitted and would be delivered to recipients shortly.