cyber
cyber copied to clipboard
Make static variables thread-local
In response to https://github.com/fubark/cyber/issues/11#issuecomment-1408977386 I wonder if making static variables thread-local would serve the purpose they do now with the great benefit of being safe and fast for multithreading?
Related: https://github.com/fubark/cyber/commit/0d800438baf11e074540be5c1429060d0667420a
Does this add overhead for single threaded use case? I'm also not clear about how Cyber will do threading at both the script level and embedded level, so this is not urgent.
It should not add basically any overhead. Nim uses only thread-local variables everywhere and Nim's peformance is equal to C in single-threaded.