English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2009-08-07 (09:31)
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
then the result is


But without the thread package the result is


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

Christoph Bauer