Helco / zzio

Zanzarah - WIP modding tools and engine remake
MIT License
14 stars 3 forks source link

Deadlock in asset registry #386

Open Helco opened 1 month ago

Helco commented 1 month ago

When (ab)using the asset registry in a highly parallel fashion we will run into deadlocks, where all threadpool threads are synchronously waiting on some async asset task. This can be observed in the validation-command branch when run over all assets.

Synchronous asset loading (as was the norm before asset registry) was added to not massively complicate the existing game code and should be kept. Zanzarah is a single-threaded game, so is zzio, even though we might speed up asset loading in isolation of the other code. Here is a possible solution: