Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework asynchronous asset registry #391

Draft
wants to merge 29 commits into
base: master
Choose a base branch
from
Draft

Conversation

Helco
Copy link
Owner

@Helco Helco commented Oct 30, 2024

Some time ago I theorized that the asset registry has a race condition regarding the order of apply actions (see #344). Also during development of an asset validation command I discovered a very real deadlock (see #386) which can happen when secondary assets fail to load and some (in hindsight) shoddy locking mechanisms in Asset.PrivateLoad

I now want to:

  • Add sufficient amount of unit tests before reworking
  • Rework locking mechanism of Asset.PrivateLoad
  • Add proper asynchronous loading of assets (for parallel tools) alongside the synchronous interface (for gameplay)
  • Prevent any synchronous waits outside of the main thread
  • (at least attempt to) Prevent any asynchronous waits without cancellation tokens registered
  • Workaround STA not being available on Linux (causing NUnit to not be single-threaded)
  • Fix smaller bugs and refactorings when convenient, e.g.:
    • AssetHandle equality
    • AssetHandle.Registry in regards to local registries and handle scopes
    • Inspecting all exceptions from secondary asset loads or multiple primary asset loads
    • Prevent recursive asset dependencies

More test cases (with two currently failing)
This breaks everything eeeveen further
- Not queuing low assets
- Not dereferencing assets
- Not queuing apply actions
- Readd STA and postpone fixing Linux CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant