caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Trevor Jim <trevor@research.att.com>
To: caml-list@yquem.inria.fr
Subject: effect of -thread with ocamlc/ocamlopt -c
Date: Tue, 12 Sep 2006 13:07:32 -0400	[thread overview]
Message-ID: <4506E954.8080207@research.att.com> (raw)

I have a question about the effect of -thread when used
with ocamlc/ocamlopt -c.

The manual states:

   All object files on the command line must also have been compiled
   with the -thread option

However, in compiling a large number of files I have not yet found a
case where -thread made a difference in the output of ocamlc or
ocamlopt (provided of course that module Thread is not used).  In
other words, the binary output is identical.

So, in general, can I take a .cmo or .cmx file that was NOT compiled
with -thread and link it with the threads library threads.cma or
threads.cmxa?

And, in general, can I take a .cmo or .cmx file that WAS compiled with
-thread but which does not use module Thread, and link it into a
program without the threads library?


Here's why this matters to me.  I have a large app (galax, with 300+
modules) that started out unthreaded.  I have added a threaded server,
which extends the app with one file that uses the Thread module.  So I
have a server that needs to be threaded, plus all the old programs
(galax compiler, etc.) that don't need to be threaded.  Linking in the
threads library causes the programs that don't use or need threads to
slow down by 2-30 times.

Since the program is so large, I would prefer not to have to compile
each module twice, once with threads and once without.

Also, it relies on a large number of libraries.  I don't want to have
to have two versions of each library.

But the manual seems to imply that I need to do that.

-Trevor


             reply	other threads:[~2006-09-12 17:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-12 17:07 Trevor Jim [this message]
2006-09-12 21:29 ` [Caml-list] " Jonathan Roewen
2006-09-12 21:34 ` Jonathan Roewen
2006-09-13 14:59   ` Trevor Jim
2006-09-13 16:34     ` Jacques Garrigue
2006-09-13 16:57       ` Trevor Jim
2006-09-13 17:40       ` Xavier Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4506E954.8080207@research.att.com \
    --to=trevor@research.att.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).