Using a global entity ID counter under a lock in an ECS is inefficient and problematic for multithreaded environments.
Claims
Using a global entity ID counter under a lock in an ECS is inefficient and problematic for multithreaded environments.
Parent: Software EngineeringEntity: ECS ImplementationImpact: negativeDate: Oct 2, 2026Target: Efficiency of ECS implementation in multithreaded environments
Source posts
@molko is:
- Writing an ECS (ugh),
- Global Entity ID counter increments under A LOCK (WHAT?!).
"I might create new entities on a new thread."
...*WHAT?*
IT DOESN'T EVEN RETURN MULTIPLE IDs LIKE `glGenBuffers()`.
It locks and outputs an entity ONCE per lock. ONCE PER LOCK!
...
At this point, if it's not "dum-dum C code",
I barely want to touch it anymore-
#CSharp #ECS #GameDev #LowLevel #LowLevelDev #DotNet #OOP #Multithreading #Performance #Programming #C #CPP #CPlusPlus
0 boosts · 3 favs · 0 replies · Oct 2, 2026
#csharp#ecs#gamedev#lowlevel#lowleveldev#dotnet
@molko824 is:
- Writing an ECS (ugh),
- Global Entity ID counter increments under A LOCK (WHAT?!).
"I might create new entities on a new thread."
...*WHAT?*
IT DOESN'T EVEN RETURN MULTIPLE IDs LIKE `glGenBuffers()`.
It locks and outputs an entity ONCE per lock. ONCE PER LOCK!
At this point, if it's not dum-dum C code,
I barely want to touch it anymore-
0 boosts · 0 favs · 0 replies · Oct 2, 2026