caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Yamagata Yoriyuki <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
Date: Wed, 02 Jul 2003 08:13:35 +0900 (JST)	[thread overview]
Message-ID: <20030702.081335.126569817.yoriyuki@mbg.sphere.ne.jp> (raw)
In-Reply-To: <20030701133415.GA28214@redhat.com>

From: Richard Jones <rich@annexia.org>
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


      parent reply	other threads:[~2003-07-01 23:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-01 13:34 Richard Jones
2003-07-01 15:24 ` Michel Christophe
2003-07-01 23:13 ` Yamagata Yoriyuki [this message]

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=20030702.081335.126569817.yoriyuki@mbg.sphere.ne.jp \
    --to=yoriyuki@mbg.sphere.ne.jp \
    --cc=caml-list@inria.fr \
    --cc=rich@annexia.org \
    /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).