Skip to content

[BUGFIX] Protect from data races when loading and staging models - #691

Merged
sdatkinson merged 3 commits into
mainfrom
647-data-race
Nov 24, 2026
Merged

sdatkinson merged 3 commits into
mainfrom
647-data-race

Conversation

@sdatkinson

@sdatkinson sdatkinson commented Nov 24, 2026 •

Copy link
Copy Markdown
Owner

Description

Model and cabinet loads can overlap with audio processing. The cabinet loader previously published the primary processor, right-channel copy, and WAV gain flag separately. When switching between mono and stereo cabinets, the audio thread could take those values from different loads and end up with a mono cabinet missing its right-channel processor.

Group the cabinet processors and WAV flag into one object, and use a shared mutex to publish and consume staged model and cabinet changes. At the start of each block, the audio thread tries to acquire the mutex. If staging is busy, playback continues with the current processors and retries on the next block.

Adds a stress test where models are swapped a lot.

Resolves #647

PR Checklist

  • Did you format your code using format.bash?
  • [N] Does your PR add, remove, or rename any plugin parameters?
  • [N] Does your PR add or remove any graphical assets?

@sdatkinson
sdatkinson merged commit e4d3f5b into main Nov 24, 2026
2 checks passed
@sdatkinson
sdatkinson deleted the 647-data-race branch November 24, 2026 20:31
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.

Data race when staging loaded model/IR for audio-thread handoff

1 participant