From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA30168; Wed, 2 Jul 2003 01:15:10 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id BAA29605 for ; Wed, 2 Jul 2003 01:15:09 +0200 (MET DST) Received: from smtp.mbg.ocn.ne.jp (mbg.ocn.ne.jp [210.190.142.181]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h61NF7f21150 for ; Wed, 2 Jul 2003 01:15:08 +0200 (MET DST) Received: from localhost (p18049-adsau12honb7-acca.tokyo.ocn.ne.jp [220.99.22.49]) by smtp.mbg.ocn.ne.jp (Postfix) with ESMTP id 3F4A92322; Wed, 2 Jul 2003 08:15:04 +0900 (JST) Date: Wed, 02 Jul 2003 08:13:35 +0900 (JST) Message-Id: <20030702.081335.126569817.yoriyuki@mbg.sphere.ne.jp> To: rich@annexia.org Cc: caml-list@inria.fr Subject: Re: [Caml-list] Threads & the order that module initialization code runs From: Yamagata Yoriyuki In-Reply-To: <20030701133415.GA28214@redhat.com> References: <20030701133415.GA28214@redhat.com> X-Mailer: Mew version 2.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; yamagata:01 yoriyuki:01 sphere:01 caml-list:01 threads:01 initialized:01 ocamlc:01 ocamlopt:01 cmx:01 emits:01 linked:01 compiler:01 cmo:01 linking:02 modules:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Richard Jones Subject: [Caml-list] Threads & the order that module initialization code runs Date: Tue, 1 Jul 2003 14:34:15 +0100 > It's obviously going to be a problem if the initialization code in > Network hasn't run by the time the machine threads have been started > up in Main (or if the network thread itself gets started up first). > > Now it all seems to work, but am I being lucky or do module > initializers run in some sort of well-defined order I can depend on? The modules are initialized in order of their linking. You will be safe if you do ocamlc -o program network.cmo ... main.cmo or ocamlopt -o program network.cmx ... main.cmx Since you refer Network in Main, the compiler emits an error if network.cmo is not linked before main.cmo, anyway. -- Yamagata Yoriyuki ------------------- 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