1 Threads
dxtr edited this page 2026-10-20 03:15:27 +02:00

Threads

A graph or a grid is used from one thread at a time, finding paths included: a search keeps its state in the graph or grid it searches, as Godot's does, so two searches of the same one at once would spoil each other's. Different graphs and grids may be used from different threads at once, and nothing in cl-astar is shared between them.

To search one map from many threads, as the workers of a job pool might, give each thread a graph or grid of its own, or take turns with a lock.

The methods of Costs of Your Own run on the thread that searches.