caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sylvain Le Gall <sylvain@le-gall.net>
To: caml-list@inria.fr
Subject: Re: windows, threads and sockets
Date: Fri, 7 Aug 2009 08:34:36 +0000 (UTC)	[thread overview]
Message-ID: <slrnh7npos.rtu.sylvain@gallu.homelinux.org> (raw)
In-Reply-To: <BB046CA812535C45BD0029AA9D04BA7906700DFB@KL-SRV57.lmsintl.com>

Hello,

On 07-08-2009, Christoph Bauer <christoph.bauer@lmsintl.com> wrote:
>> > Any ideas?
>> 
>> I can't tell you explicitly why it has failed, but 
>> Unix.select was completely rewritten for OCaml 3.11.0 based 
>> on a big contribution from Sylvain Le Gall (see 
>> otherlibs/win32unix/select.c). The principal aim was to make 
>> the semantics of Unix.select the same between *NIX and 
>> Windows so if it works on Linux then it sounds like you've 
>> hit a bug...
>> 
> Good to know, I missed that change. So the new Unix.select should
> now work also on pipes? I guess it from the function named
> read_pipe_poll()
> in select.c. This is good news, because I can throw away some
> workarounds.

In no-thread context, it works great... (with pipe and console et al)

>
> But maybe the problem with thread is, that not
> otherlibs/win32unix/select.c
> is used. There is also otherlibs/threads/unix.ml with seems to overwrite
> Unix.select
> and there are select() calls in otherlibs/threads/scheduler.c. I'm just
> guessing
> here.

Indeed, I miss this case because I don't use thread in ocaml code.
However I don't see interaction between otherlibs/win32unix/select.c and
otherlibs/threads/unix.ml, so I am not sure where the bug comes from.

It also show that pipe/console is not available when you use select with
thread :( 

Something that can change is that we now use WinSock 2.0...

>
> So maybe the simples solution for me (I have to stick to 3.11.0)
> would be to create my thread in plain C, link against is and omit the
> dreaded threads library ;-) The task of my thread is very simple...
>

Regards,
Sylvain Le Gall


  reply	other threads:[~2009-08-07  8:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-07  7:43 Christoph Bauer
2009-08-07  7:54 ` [Caml-list] " David Allsopp
2009-08-07  8:17   ` Christoph Bauer
2009-08-07  8:34     ` Sylvain Le Gall [this message]
2009-08-07  8:39 ` Sylvain Le Gall
2009-08-07  9:30   ` [Caml-list] " Christoph Bauer
2009-08-07 10:06     ` Sylvain Le Gall
2009-08-07 10:55       ` [Caml-list] " Christoph Bauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=slrnh7npos.rtu.sylvain@gallu.homelinux.org \
    --to=sylvain@le-gall.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).