-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] switch threads to on by default #361
Comments
Completely agree and wanted to bring this up one day myself... :-) Btw |
can there be any potential drop in performance for single threaded apps with |
right, nobody should complain if |
not sure what you mean? in reference to https://github.com/nim-lang/Nim/issues/9878#issuecomment-445050346 as long as there's an option (which doesn't have to be the default) to get maximum performance (even if that means single thread, and even if that implies
that would be undesirable if it affects "max performance for apps that don't care about multi-thread" |
@timotheecour Thread local storage continues to be slightly slower than global variables and it not as well supported on less common (embedded) platforms. But we map |
As long as issues like these pop up then I don't think we're ready to do this: dom96/nim-in-action-code#6 The GC safe system in Nim is still a tad too annoying and enabling threads turns warnings into errors. |
I disagree, you can use your globals in a |
implemented by nim-lang/Nim#19368 |
Currently,
--threads:off
is the default. I'd like to propose that this is switch toon
by default (with a view to remove it completely at some point, or even now).I remember the good old days, 20 years ago, when
C
libraries were split between threaded and multithreaded versions - actually, they days were not that good at all. There was lots of confusion, educational effort and annoying issues caused by this:_r
variants in the C library, orerrno
actually being a function call hidden behind a macro etc)In most cases, code that is thread safe can also be used in single-threaded setups. Thus, I'd recommend we turn threads on by default in nim:
rand
and friends)alternatively, we make the option a noop / deprecated (I actually prefer this option - much more simple) - if it really matters, the compiler can be made smart enough to detect if threads are actually used
The text was updated successfully, but these errors were encountered: