Browse thread
effect of -thread with ocamlc/ocamlopt -c
[
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: | 2006-09-13 (14:59) |
From: | Trevor Jim <trevor@r...> |
Subject: | Re: [Caml-list] effect of -thread with ocamlc/ocamlopt -c |
Well, I'm still confused. Consider that a bunch of the standard libraries use Pervasives, but I can see that the standard library is not compiled with -thread. So clearly we are meant to use the standard library compiled without -thread, with threads.cm[x]a. So, I still don't understand when I can combine code compiled without -thread with code compiled with -thread. -Trevor Jonathan Roewen wrote: > Oh wait, I'm sorry. Yes, there is good reason: it uses a different > version of Pervasives internals. > > Depending on when linking is done for each part, you may end up with > conflicting implementations of Pervasives in your final program: so > [IO] operations that can block will block whole program instead of > running thread blocking, and another thread running instead. > > So maybe if it uses no IO, and no threading functions, it might be > okay -- there are no guarantees when you do these sorts of things (: > > Jonathan