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

Thread-safety : get rid of static fields #87

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MikOfClassX
Copy link

Remove dangerous static reference to fields and fix possible concurrency issues

@yuripourre
Copy link

yuripourre commented Nov 10, 2022

@MikOfClassX you know that removing static, for every instance you are creating new attributes, right? More memory is necessary.

That's a trade-off that not everyone is willing to take.

There are some interesting codes in your PR that could be a separate (less risky PR).

@MikOfClassX
Copy link
Author

@yuripourre class data uses per-instance memory (included the static instance), Now the question is "how much ?".

I may agree with you that extra memory may have some impact as long as we have a raw idea of how much in a general scenario. Extra memory of a float vector[3] is 24 bytes per instance. Can we afford this ? Surely we can.

So, while I don't see the risk of (possible) extra bytes, I see more the benefits.

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

Successfully merging this pull request may close these issues.

3 participants