Replies: 2 comments 4 replies
-
|
You don't have to guard a registry as a whole. Quite the opposite. As long as you don't write modify the same pools from different threads, you're fine. |
Beta Was this translation helpful? Give feedback.
-
|
@skypjack In my case, the workload comes from streaming meshes from a third-party library, and each mesh requires creating a new entity and assigning a MeshComponent to it. From what I understand, entity creation and writing to the same component pool (MeshComponent) cannot safely happen concurrently from multiple threads. Is that correct? If that's the case, how would you approach this kind of scenario? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I'm using EnTT as the main representation of my scene for 3D simulations. I’d like to multithread scene modifications. Let’s say I have many worker threads that may need to modify any component in the registry.
How would you approach this?
I’ve already protected entity creation, but when it comes to modifying the registry, I was thinking about using a queue of commands that are dequeued and executed on a single thread. However, this could result in a large number of small lambdas that might hurt performance.
I also heard about using a local registry per thread that gets merged back into the main one at the end of the frame. Is that a viable approach?
I’d be happy to get any feedback on this.
Thanks,
Baptiste
Beta Was this translation helpful? Give feedback.
All reactions