caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* windows, threads and sockets
@ 2009-08-07  7:43 Christoph Bauer
  2009-08-07  7:54 ` [Caml-list] " David Allsopp
  2009-08-07  8:39 ` Sylvain Le Gall
  0 siblings, 2 replies; 8+ messages in thread
From: Christoph Bauer @ 2009-08-07  7:43 UTC (permalink / raw)
  To: caml-list

Hi,

I'm using OCaml 3.11.0. My question is about my program,
which used to work fine under windows and linux. The program
is a daemon, which waits for socket connections and respondse
to queries.

Now I added an extension with uses threads. Everything is
find on linux, but I have a very strange behaviour on windows.
For the troubles it is sufficient to link agains threads and compile the
main program with -thread. Without it everything is fine again.

I'm not quite sure what is going on, but my best bet is this: the main
loop waits for the sockets with

Unix.select listOfSockets [] [] timeout

One socket is the listener socket on which new connections 
are made. Unix.select returns a list of sockets. Initially
it must be the listener socket. This is checked with a compare

  socket = listenSocket 

and this seems to be suddenly wrong (just in the thread case).

Any ideas?

Thanks,

Christoph Bauer


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-08-07 10:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-07  7:43 windows, threads and sockets 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
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

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).