[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Xavier Leroy <xavier.leroy@i...> |
| Subject: | Re: [Caml-list] native threads, connect |
Hi François, > I'm upgrading some very old network code of mine to Ocaml 3.05, > and I'm getting confused about the behavior of connect() in > bytecode threads vs. native threads. > As you know, to get a yieldable connect, you put a socket > in non-blocking mode, connect, and wait for the socket to > be writable. That is how connect is written in > otherlibs/threads/unix.ml. > Now on the other hand otherlibs/systhreads does not > have a specific unix.ml that defines a connect(). With POSIX or Win32 threads, connect() blocks the calling thread but not the other threads. So, Caml just goes ahead and calls connect(). The trick you mention with non-blocking sockets is just a way to emulate this behavior (block the calling thread but not the other threads) when system threads are not used and scheduling is performed at the bytecode level. > Which unix.ml is used when compiling with -threads with > bytecode and native compilers (with Ocaml configured in native > threads)? The one in otherlibs/unix in the source distribution. Hope this helps, - Xavier ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners