1 Sep 1997 17:24
Re: Thread library for ocamlopt?
Xavier Leroy <Xavier.Leroy <at> inria.fr>
1997-09-01 15:24:08 GMT
1997-09-01 15:24:08 GMT
> > * Available only on Unix systems that provide fully conformant > > Posix 1003.1c threads, e.g. Solaris 2.5, Digital Unix 4.0, or > > Linux with LinuxThreads, but not HPUX, SunOS, nor earlier > > versions of Digital Unix, for instance. > > Couldn't the implementation on the latter three OSs emulate the > semantics (without the performance benefit, of course) with the old > threads? The two thread libraries (the bytecode-level one and the one built on top of Posix threads) have the same API and (hopefully) the same semantics, so, as you say, the bytecode-level library can still be used as a fallback solution on operating systems that do not provide Posix threads. > Then programs would remain portable and users of > multiprocessor machines running the former three OSs could start > chasing around the FORTRAN crowd(Continue reading). The only remaining problem is that the OCaml code is still essentially single-threaded -- by lack of a suitable GC, we can't have more than one thread executing Caml code at any given time. So, the Caml code can't exploit a multiprocessor. I/O operations and code written in C can still run concurrently with the Caml code, though. Overall, the Caml thread libraries won't make your code run faster; they are mainly useful to facilitate overlapping I/O and other forms of asynchronous communications. > > * Preemption of long-running threads can only occur at
.
The only remaining problem is that the OCaml code is still essentially
single-threaded -- by lack of a suitable GC, we can't have more than
one thread executing Caml code at any given time. So, the Caml code
can't exploit a multiprocessor. I/O operations and code written in C
can still run concurrently with the Caml code, though.
Overall, the Caml thread libraries won't make your code run faster;
they are mainly useful to facilitate overlapping I/O and other forms
of asynchronous communications.
> > * Preemption of long-running threads can only occur at
RSS Feed