test.nim:
var count1 {.threadvar.}: int
var count2 {.global.}: int
var count3 : int # nim says this is global, not threadvar
Run
nim follows the C and C++ route here; seems like the D route (thread local by
default) is safer, and potentially more efficient (less concurrency issues)
* Curious why this is the case?
* if the reason is it'd prevent common idiom var count3 = 3 (which currently
errors as: "Error: a thread var cannot be initialized explicitly; this would
only run for the main thread"), this could be fixed.
* too late to change because it'd break code?