gdx-gltf icon indicating copy to clipboard operation
gdx-gltf copied to clipboard

Thread-safety : get rid of static fields

Open MikOfClassX opened this issue 2 years ago • 2 comments

Remove dangerous static reference to fields and fix possible concurrency issues

MikOfClassX avatar Nov 10 '22 17:11 MikOfClassX

@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).

yuripourre avatar Nov 10 '22 18:11 yuripourre

@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.

MikOfClassX avatar Nov 11 '22 07:11 MikOfClassX