From: Dennis S. <mus...@wi...> - 2014-01-28 21:27:27
|
On Tue, 28 Jan 2014 10:48:38 +0100 Florian Jung <fl...@wi...> wrote: > > Yes of course, if we use locks, then gather up all changes that we possibly > > can and then apply them in one quick burst inside a lock. > > Just... I don't know if that's as quickly done as said. > > Depends on your view of "quick". > > It will not be as quick as we would need for realtime operations. It > would be too slow if the *audio* thread would wait for this lock. > > But the audio thread doesn't. The *prefetch* thread waits for this lock, > and thus, we may take up to half as long as our prefetch queue is. Are you sure about this? As long as the model is in inconsistent state that audio thread can't reliably access it. But then, acquiring a mutex in the audio thread will be a sure receipt for dropouts. I see the point with undo/redo. And as Tim points out, that it already provides the infrastructure for a "list of changes to be applied" on the model. But even with this list I think there should be a "working copy" of the model objects. If a pointer swap can't be atomic one could pass the new model pointer to the audio thread through the ring buffer. Dennis |