Why is it so important to worry so much about consistent path/map data, or pathfinding requests to return on the same frame as they were issued on? I rather like the thought of
seeing my dwarves spending time thinking, i.e. have them flash a blue '?' for a frame or two. And if the path gets invalid between frames, that doesn't strike me as any different than a bridge raised just before Urist tries to cross it. Just have the path request work with a copy of the map segment that stays the same as long as that particular PF thread is searching.
The question that seems much more promising to me is how/
if Toady uses any kind of partitioning for map data and (especially) item lists, beyond that connectivity map. For example, in the tile based game I'm developing solely in my head (
) I'd use sectors of 8x8 tiles for PF, with HPA* (pathfinding algorithm using hierarchical levels of detail) and an index of all item resources in that sector for quick lookups. That should also lend itself to threaded PF. Map (sector) changes would keep a history of as many frames as needed for the PF threads to complete. At the same time, all the weather/temperature/liquid flowing could probably easily done in parallel influence maps, each of them a nicely sized chunk of workload for a thread pool (there are even GPU implementations of influence maps out there). Parallelizing an engine doesn't have to mean a number of permanent threads, you can just as well identify independent steps in your frame sequence and compute those in parallel.
Then again I know Toady has thought about this stuff far longer than I ever have, so his way of dealing with this stuff would really interest me.