justin = { main feed , music , code , askjf , pubkey };
Ask Justin Frankel
No reasonable question unanswered since 2009!

Suggested topics: programming, music, sleep, coffee, etc.

Note: please do not ask questions about REAPER features, bugs or scheduling, use the forums instead.


Name: Ask: Human (enter yes):
[back to index] | [unreplied] | [replied] | [recent comments] | [all]

Question: How do you edit the audio graph while the audio callback is running in a DAW? I read an articel that said you shouldn't do dynamic allocations on the audio thread. Are you supposed to allocate stuff on another thread and then atomically swap a pointer owned by the audio thread?
Asked by Edward (198.58.185.x) on December 29 2025, 4:30pm
Reply on December 29 2025, 6:02pm:
    yes you want to avoid allocating on the audio thread if possible. better to allocate from the main thread or a worker thread, then swap it in. IMO doesn't have to be atomic, you can use a mutex, just want to make sure that any threads that hold a mutex (that the audio thread waits for) only hold it for a very short time (e.g. swapping pointers etc).

Comment:
    Your Name:   -- Site Owner's Name:  (for human-verification)

    Comment:    

    
  
[back to index] | [unreplied] | [replied] | [recent comments] | [all]
Copyright 2025 Justin Frankel. | RSS