Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
windows, threads and sockets
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: windows, threads and sockets

On 07-08-2009, Christoph Bauer <> wrote:
>> > Any ideas?
>> I can't tell you explicitly why it has failed, but 
>> 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 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 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/ with seems to overwrite
> 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/, 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...

Sylvain Le Gall