Gaffer Docs

Data Segregation

Each game loop has its own list of Processes that it updates on each iteration. Gaffer automatically load balances processes within these loops by keeping track of which Actors each Process has ownership over.

Gaffer ensures that for any given Actor, all Processes that own this Actor run within the same game loop, and thus within the same thread. Since processes within one game loop never update concurrently, there is no need for locking or synchronization between them.

If a Process starts to use a new actor, a re-balancing operation may be necessary since that actor may already be owned by Processes within a different game loop.

The "secret sauce" of Gaffer, and what makes the APE Pattern viable for high performance game programming is balancing Processes efficiently and optimally accross game loops at runtime. When it works well, clients of the library simply program the Processes needed by their application, and don't concern themselves with threads or concurrency. Concurrency is achieved transparently without the increased code complexity usually required by traditional approaches.