From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p249LNvd030731 for ; Fri, 4 Mar 2011 10:21:23 +0100 X-IronPort-AV: E=Sophos;i="4.62,263,1297033200"; d="scan'208";a="101246323" Received: from mp-57040.rocqadm.inria.fr ([128.93.57.40]) by mail1-relais-roc.national.inria.fr with ESMTP/TLS/AES128-SHA; 04 Mar 2011 10:21:17 +0100 Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=iso-8859-1 From: xclerc In-Reply-To: Date: Fri, 4 Mar 2011 10:21:17 +0100 Cc: xclerc Clerc Message-Id: <3935749A-AF2C-43E1-A015-286513644996@inria.fr> References: To: Caml List X-Mailer: Apple Mail (2.1082) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p249LNvd030731 Subject: Re: [Caml-list] Using C threads Le 4 mars 2011 à 00:46, Niki Yoshiuchi a écrit : > My main program is in OCaml. Thread.thread_initialize is only called > if you actually use the module in question. I tested this with some > simple code: > > main.ml: (ocamlc -c main.ml) > > let _ = Printf.printf "Main\n" > > test.ml: (ocamlc -c test.ml) > > let _ = Printf.printf "Test\n" > > test2.ml: (ocamlc -o test2.cma -a test2.ml) > > let _ Printf.printf "Test2\n" > > ocamlc test2.cma test.cmo main.cmo > ./a.out > Test > Main > > "Test2" never gets printed. Seems to work with "ocamlc -linkall test2.cma test.cmo main.cmo". Regards, Xavier Clerc