Function ecs_query_next_worker

Synopsis

#include <include/flecs.h>

FLECS_API bool ecs_query_next_worker(ecs_iter_t *it, int32_t stage_current, int32_t stage_count)

Description

Progress the query iterator for a worker thread. This operation is similar to ecs_query_next, but provides the ability to divide entities up across multiple worker threads. The operation accepts a current thread id and a total thread id, which is used to determine which subset of entities should be assigned to the current thread.

Current should be less than total, and there should be as many as total threads. If there are less entities in a table than there are threads, only as many threads as there are entities will iterate that table.

Parameters

it - The iterator.

stage_current - Id of current stage.

stage_count - Total number of stages.

Returns
True if more data is available, false if not.

Source

Line 2347 in include/flecs.h.