Version française
Home     About     Download     Resources     Contact us    
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: Christoph Bauer <christoph.bauer@l...>
Subject: RE: [Caml-list] Re: windows, threads and sockets

> Do you mean that the following code is wrong with 3.11.1 and 
> not 3.10.2:
> 
> let res_listener = Unix.select listOfSockets [] [] timeout in 
> (List.nth res_listener 0) = listenSocket
> 
> Can you find listenSocket in the result elsewhere ?

No! I try to clarify: 

my check is then 

  match Unix.select sockets [] [] timeout with
     | (l,_,_) ->
          List.iter (fun sock -> printf "%b,%b\n" (List.mem sock
sockets) (List.memq sock sockets)) l

I only use OCaml 3.11.0. It only happens on windows.

If I compile and link with -thread and link with ocamlfind ... -package
threads
then the result is

  false,false

But without the thread package the result is

  true,true


BTW, I use systhreads, but the files (scheduler.c, unix.ml) I mentioned
before are used in the vmthread case.
In otherlibs\systhreads\threadUnix.ml I found

let select = Unix.select

Regards,
Christoph Bauer