How to make a global constant thread local?

You can create an empty array (or array of whatever size) where you define bar and then resize! it in an __init__() method (see here: Modules · The Julia Language).

2 Likes