Thijs van Dien
Thijs van Dien

Reputation: 6616

What can I assume about unit initialization?

The documentation describes unit initialization to happen at program startup, but in case of (automatically loaded) BPLs there are exceptions. The order is determined by dependencies between units, so this I cannot assume to be the same always. What can I assume about unit initialization? This may be a broad question, but I expect the answers to the sub-questions below to be highly related.

I have not been able to find documentation that goes more deeply into this.

Upvotes: 2

Views: 141

Answers (1)

David Heffernan
David Heffernan

Reputation: 613262

Under what conditions does a unit get initialized at all?

All units included in your module are initialized.

Does all initialization indeed happen at startup or does the documentation oversimplify?

Units are initialized during startup, when the module is loaded.

Is it strictly sequential, meaning each unit is fully initialized before the next?

Yes.

Is all initialization performed in the main thread?

Yes.

Upvotes: 5

Related Questions