SQLite3 and threads

Ali Çehreli via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Mar 1 22:06:21 PST 2015


On 03/01/2015 09:47 PM, Vitalie Colosov wrote:

 > global variable

A module-scope variable is thread-local by-default. Every thread will 
have a copy of that variable.

If you want to share data, you must define it as 'shared' (or __gshared).

 > which was populated in main() function

In that case only the main thread's variable would be initialized. 
Shared variables should be initialized in 'shared static this()' scopes.

Ali



More information about the Digitalmars-d-learn mailing list