From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.3 required=5.0 tests=DNS_FROM_RFC_WHOIS, SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 7AC74BC4F for ; Tue, 12 Sep 2006 19:07:37 +0200 (CEST) Received: from mail-red.research.att.com (mail-red.research.att.com [192.20.225.110]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id k8CH7aR6023932 for ; Tue, 12 Sep 2006 19:07:37 +0200 Received: from [135.207.28.68] (fpdhcp068.research.att.com [135.207.28.68]) by bigmail.research.att.com (8.13.3+Sun/8.11.6) with ESMTP id k8CH7a19026786 for ; Tue, 12 Sep 2006 13:07:36 -0400 (EDT) Message-ID: <4506E954.8080207@research.att.com> Date: Tue, 12 Sep 2006 13:07:32 -0400 From: Trevor Jim User-Agent: Thunderbird 1.5.0.5 (X11/20060728) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: effect of -thread with ocamlc/ocamlopt -c Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 4506E958.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; -thread:01 ocamlc:01 ocamlopt:01 -thread:01 ocamlc:01 ocamlopt:01 binary:01 cmo:01 cmx:01 threads:01 threads:01 cmxa:01 cmo:01 cmx:01 compiler:01 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