Skip to content
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

.gcsafe. everywhere #68

Closed
sinkingsugar opened this issue Feb 3, 2020 · 2 comments
Closed

.gcsafe. everywhere #68

sinkingsugar opened this issue Feb 3, 2020 · 2 comments

Comments

@sinkingsugar
Copy link
Contributor

Minor but for sanity, I could not help to notice that {.gcsafe.} is everywhere basically in the code base.
Iirc there was a bug long time ago with methods spitting lot of warnings maybe which I actually reported but it was fixed I think.
I did not try yet but the notation is literally "asking for troubles" usually, also I see no threading (spawn etc) so it's probably really unnecessary and should be removed.
Anything I am missing?

@arnetheduck
Copy link
Contributor

we compile everything on the assumption that we'll be flipping threads on as soon as is feasible - trust is low though currently, that threads in nim actually work (it's not turned on by default so stuff like the gc rarely gets stressed, so we would only do so when we have bandwidth to deal with the fallout)

@sinkingsugar
Copy link
Contributor Author

OK I see, but well, in my experience with nim threads (as they were few months ago) any time I forced gcsafe (which btw likely needs {.gcsafe.}: block also, not just proc tag) things went wrong, as expected, due to the gc being the gc and me passing references mistakenly cos I turned off thread analysis with gcsafe.

It is true that with ARC things might be better but I doubt cos heap allocators also are generally per-thread so extra care needs to be taken.

Anyway fine for me so closing this as it's not really an issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants