caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Kinds of threads
@ 2002-09-30 13:46 Alessandro Baretta
  2002-09-30 15:18 ` [Caml-list] " Michaël Grünewald
  0 siblings, 1 reply; 11+ messages in thread
From: Alessandro Baretta @ 2002-09-30 13:46 UTC (permalink / raw)
  To: Ocaml

The docs say that there are two kinds of threads in O'Caml: 
Ocaml bytecode threads and POSIX threads, and that it is 
possible to select which implementation to use at compiler 
build time. Two questions: first, what is the implementation 
chosen in the ocaml RPM distribution; second, why must one 
choose one implementation at compiler build time? Why not 
use a compiler switch such as --posix-threads as opposed to 
--caml-threads?

Alex

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


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

* [Caml-list] Re: Kinds of threads
  2002-09-30 13:46 [Caml-list] Kinds of threads Alessandro Baretta
@ 2002-09-30 15:18 ` Michaël Grünewald
  2002-10-01  7:51   ` Alessandro Baretta
  0 siblings, 1 reply; 11+ messages in thread
From: Michaël Grünewald @ 2002-09-30 15:18 UTC (permalink / raw)
  To: caml-list

Alessandro Baretta <alex@baretta.com> writes:

> The docs say that there are two kinds of threads in O'Caml: Ocaml
> bytecode threads and POSIX threads, and that it is possible to select
> which implementation to use at compiler build time. Two questions:
> first, what is the implementation chosen in the ocaml RPM distribution;
> second, why must one choose one implementation at compiler build time?
> Why not use a compiler switch such as --posix-threads as opposed to
> --caml-threads?

Depending of the platform, POSIX threads may not or badly
available. Emulation can be set up, either by coercing existing thread
capabilities to the POSIX interface, or by implementing a POSIX thread
library, using processes and interprocesses communications to do the job (i
have been told it was the way with linux, please confirm or infirm it).

Maybe the switch is here because it is better to use POSIX threads when they
are well supported by the system (e.g. BSDs); but the caml thread emulation
may give better results in (some) other cases.
-- 
Michaël Grünewald <michael-grunewald@wanadoo.fr>  - RSA PGP Key ID: 0x20D90C12
-------------------
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


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

* Re: [Caml-list] Re: Kinds of threads
  2002-09-30 15:18 ` [Caml-list] " Michaël Grünewald
@ 2002-10-01  7:51   ` Alessandro Baretta
  2002-10-01  7:52     ` Remi VANICAT
                       ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Alessandro Baretta @ 2002-10-01  7:51 UTC (permalink / raw)
  To: Michaël Grünewald; +Cc: caml-list



Michaël Grünewald wrote:
> Alessandro Baretta <alex@baretta.com> writes:
> 
> 
>>The docs say that there are two kinds of threads in O'Caml: Ocaml
>>bytecode threads and POSIX threads, and that it is possible to select
>>which implementation to use at compiler build time. Two questions:
>>first, what is the implementation chosen in the ocaml RPM distribution;
>>second, why must one choose one implementation at compiler build time?
>>Why not use a compiler switch such as --posix-threads as opposed to
>>--caml-threads?
> 
> 
> Depending of the platform, POSIX threads may not or badly
> available. Emulation can be set up, either by coercing existing thread
> capabilities to the POSIX interface, or by implementing a POSIX thread
> library, using processes and interprocesses communications to do the job (i
> have been told it was the way with linux, please confirm or infirm it).

I don't really know what you mean by "emulation", but, yes, 
LinuxThreads is POSIX-compliant extension to glibc which 
instantiates kernel-level processes.

> Maybe the switch is here because it is better to use POSIX threads when they
> are well supported by the system (e.g. BSDs); but the caml thread emulation
> may give better results in (some) other cases.

Caml threads are probably the only way to go on Windows, 
since the Win32 API is not POSIX compliant.

Still, this does not answer my question: what is the 
threading style chosen for the official RPM distribution of 
O'Caml? Let me see if I can figure this out by myself...

Alex

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


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

* Re: [Caml-list] Re: Kinds of threads
  2002-10-01  7:51   ` Alessandro Baretta
@ 2002-10-01  7:52     ` Remi VANICAT
  2002-10-01  9:12     ` Xavier Leroy
  2002-10-01  9:13     ` Benjamin Monate
  2 siblings, 0 replies; 11+ messages in thread
From: Remi VANICAT @ 2002-10-01  7:52 UTC (permalink / raw)
  To: caml-list

Alessandro Baretta <alex@baretta.com> writes:

> Still, this does not answer my question: what is the threading style
> chosen for the official RPM distribution of O'Caml? Let me see if I
> can figure this out by myself...
>

One easy way to find out is to try to run a multi-threaded application
compiled to native code.
-- 
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat
-------------------
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


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

* Re: [Caml-list] Re: Kinds of threads
  2002-10-01  7:51   ` Alessandro Baretta
  2002-10-01  7:52     ` Remi VANICAT
@ 2002-10-01  9:12     ` Xavier Leroy
  2002-10-01 10:28       ` Sven Luther
  2002-10-02  7:46       ` Stefano Zacchiroli
  2002-10-01  9:13     ` Benjamin Monate
  2 siblings, 2 replies; 11+ messages in thread
From: Xavier Leroy @ 2002-10-01  9:12 UTC (permalink / raw)
  To: Alessandro Baretta; +Cc: Michaël Grünewald, caml-list

> The docs say that there are two kinds of threads in O'Caml: 
> Ocaml bytecode threads and POSIX threads, and that it is 
> possible to select which implementation to use at compiler 
> build time. Two questions: first, what is the implementation 
> chosen in the ocaml RPM distribution

The RPMs distributed by INRIA use bytecode threads.  That might not be
true of RPMs and Debian packages built by third parties.

> second, why must one choose one implementation at compiler build
> time? Why not use a compiler switch such as --posix-threads as opposed
> to --caml-threads?

Mostly because the idea didn't cross my mind.  Offhand, I believe that
just playing with the search path would suffice to select between the
two implementations.  (This needs to be checked, though.)

> Caml threads are probably the only way to go on Windows, 
> since the Win32 API is not POSIX compliant.

Amusingly, it's the other way around: bytecode threads use a lot of
Unix-specific hacks to get non-blocking I/O, while system threads can
easily be built on top of Win32 threads (even though the latter aren't
POSIX-compliant).

- Xavier Leroy
-------------------
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


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

* Re: [Caml-list] Re: Kinds of threads
  2002-10-01  7:51   ` Alessandro Baretta
  2002-10-01  7:52     ` Remi VANICAT
  2002-10-01  9:12     ` Xavier Leroy
@ 2002-10-01  9:13     ` Benjamin Monate
  2002-10-08 11:51       ` [Caml-list] Compile cameleon on debian Yang Shouxun
  2 siblings, 1 reply; 11+ messages in thread
From: Benjamin Monate @ 2002-10-01  9:13 UTC (permalink / raw)
  To: Alessandro Baretta; +Cc: caml-list

On Tue, 01 Oct 2002 09:51:08 +0200
Alessandro Baretta <alex@baretta.com> wrote:
> Still, this does not answer my question: what is the 
> threading style chosen for the official RPM distribution of 
> O'Caml? Let me see if I can figure this out by myself...
> 

Here is a small test to detect what kind of threads you have:

====================================================================
(* Compile with ocamlc -o threadtest -thread unix.cma threads.cma
threadtest.ml *) open Thread
let f () = while true do () done 
let i = create f () 
let _ = 
  try 
    kill i;
    print_string "Bytecode threads available\n"
  with Invalid_argument "Thread.kill: not implemented" 
      -> print_string "Native threads available\n"
====================================================================


Hope this helps.

-- 
| Benjamin Monate         | mailto:monate@lix.polytechnique.fr |
| LIX                     | http://www.lri.fr/~monate/         |
| École Polytechnique -  91128 Palaiseau Cedex - France        |
-------------------
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


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

* Re: [Caml-list] Re: Kinds of threads
  2002-10-01  9:12     ` Xavier Leroy
@ 2002-10-01 10:28       ` Sven Luther
  2002-10-02  7:46       ` Stefano Zacchiroli
  1 sibling, 0 replies; 11+ messages in thread
From: Sven Luther @ 2002-10-01 10:28 UTC (permalink / raw)
  To: Xavier Leroy; +Cc: Alessandro Baretta, Micha?l Gr?newald, caml-list

On Tue, Oct 01, 2002 at 11:12:38AM +0200, Xavier Leroy wrote:
> > The docs say that there are two kinds of threads in O'Caml: 
> > Ocaml bytecode threads and POSIX threads, and that it is 
> > possible to select which implementation to use at compiler 
> > build time. Two questions: first, what is the implementation 
> > chosen in the ocaml RPM distribution
> 
> The RPMs distributed by INRIA use bytecode threads.  That might not be
> true of RPMs and Debian packages built by third parties.

I build debian packages with the --with-pthread option, so this means
POSIX threads.

Friendly,

Sven Luther
-------------------
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


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

* Re: [Caml-list] Re: Kinds of threads
  2002-10-01  9:12     ` Xavier Leroy
  2002-10-01 10:28       ` Sven Luther
@ 2002-10-02  7:46       ` Stefano Zacchiroli
  1 sibling, 0 replies; 11+ messages in thread
From: Stefano Zacchiroli @ 2002-10-02  7:46 UTC (permalink / raw)
  To: caml-list

On Tue, Oct 01, 2002 at 11:12:38AM +0200, Xavier Leroy wrote:
> The RPMs distributed by INRIA use bytecode threads.  That might not be
> true of RPMs and Debian packages built by third parties.

OCaml debian package currently use native threads.

Cheers.

-- 
Stefano Zacchiroli - undergraduate student of CS @ Univ. Bologna, Italy
zack@cs.unibo.it | ICQ# 33538863 | http://www.cs.unibo.it/~zacchiro
"I know you believe you understood what you think I said, but I am not
sure you realize that what you heard is not what I meant!" -- G.Romney
-------------------
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


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

* [Caml-list] Compile cameleon on debian
  2002-10-01  9:13     ` Benjamin Monate
@ 2002-10-08 11:51       ` Yang Shouxun
  2002-10-09  6:41         ` Sven LUTHER
  0 siblings, 1 reply; 11+ messages in thread
From: Yang Shouxun @ 2002-10-08 11:51 UTC (permalink / raw)
  To: caml-list

Hi,

Is there anybody successfully compiling Cameleon 1.1 on Debian?

I'm using Debian unstable and have installed almost all the latest ocaml 
related packages.

I followed the instructions in the INSTALL file, with "./configure 
--include-dir /usr/lib/ocaml". It complained that "pa_zog.cma" not in 
the search path. I cd to zoggy subdirectory and "make pa_zog.cma" to 
resolve the problem. Other errors I don't know how to fix easily. They 
include "Unbound value C.string" in "omom_gui_variables.ml", "Unbound 
module Cam_plug" when compile "utils.ml".

That's the same with the snapshot version.

Any comments are welcome!
-------------------
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


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

* Re: [Caml-list] Compile cameleon on debian
  2002-10-08 11:51       ` [Caml-list] Compile cameleon on debian Yang Shouxun
@ 2002-10-09  6:41         ` Sven LUTHER
  2002-10-09  8:14           ` Jérôme Marant
  0 siblings, 1 reply; 11+ messages in thread
From: Sven LUTHER @ 2002-10-09  6:41 UTC (permalink / raw)
  To: Yang Shouxun; +Cc: caml-list

On Tue, Oct 08, 2002 at 07:51:19PM +0800, Yang Shouxun wrote:
> Hi,
> 
> Is there anybody successfully compiling Cameleon 1.1 on Debian?
> 
> I'm using Debian unstable and have installed almost all the latest ocaml 
> related packages.

You are aware that Jerome Marant and Stefano Zachiro are packaging
cameleon for debian. Read the thread started on :

http://lists.debian.org/debian-ocaml-maint/2002/debian-ocaml-maint-200209/msg00138.html

To see more details about the state of it.

> I followed the instructions in the INSTALL file, with "./configure 
> --include-dir /usr/lib/ocaml". It complained that "pa_zog.cma" not in 
> the search path. I cd to zoggy subdirectory and "make pa_zog.cma" to 
> resolve the problem. Other errors I don't know how to fix easily. They 
> include "Unbound value C.string" in "omom_gui_variables.ml", "Unbound 
> module Cam_plug" when compile "utils.ml".
> 
> That's the same with the snapshot version.

Friendly,

Sven Luther
-------------------
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


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

* Re: [Caml-list] Compile cameleon on debian
  2002-10-09  6:41         ` Sven LUTHER
@ 2002-10-09  8:14           ` Jérôme Marant
  0 siblings, 0 replies; 11+ messages in thread
From: Jérôme Marant @ 2002-10-09  8:14 UTC (permalink / raw)
  To: Yang Shouxun, caml-list

En réponse à Sven LUTHER <luther@dpt-info.u-strasbg.fr>:

> On Tue, Oct 08, 2002 at 07:51:19PM +0800, Yang Shouxun wrote:
> > Hi,
> > 
> > Is there anybody successfully compiling Cameleon 1.1 on Debian?
> > 
> > I'm using Debian unstable and have installed almost all the latest
> ocaml 
> > related packages.
> 
> You are aware that Jerome Marant and Stefano Zachiro are packaging
> cameleon for debian. Read the thread started on :
> 
>
http://lists.debian.org/debian-ocaml-maint/2002/debian-ocaml-maint-200209/msg00138.html
> 
> To see more details about the state of it.

Yang,

In order to compile Cameleon, you need the _compiled_ OCaml sources :
cameleon requires some files that are not installed in the OCaml
distribution.
So, grab the ocaml sources, compile them (make world opt) and
then set properly the path to these OCaml sources to the
Cameleon configure script.

FYI, The debian packages are ready and being tested at the momemt.
They're going to be release RSN.

Cheers,

--
Jérôme Marant <jerome@marant.org>
              <jerome.marant@free.fr>

http://marant.org
-------------------
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


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

end of thread, other threads:[~2002-10-09 19:11 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-30 13:46 [Caml-list] Kinds of threads Alessandro Baretta
2002-09-30 15:18 ` [Caml-list] " Michaël Grünewald
2002-10-01  7:51   ` Alessandro Baretta
2002-10-01  7:52     ` Remi VANICAT
2002-10-01  9:12     ` Xavier Leroy
2002-10-01 10:28       ` Sven Luther
2002-10-02  7:46       ` Stefano Zacchiroli
2002-10-01  9:13     ` Benjamin Monate
2002-10-08 11:51       ` [Caml-list] Compile cameleon on debian Yang Shouxun
2002-10-09  6:41         ` Sven LUTHER
2002-10-09  8:14           ` Jérôme Marant

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