![]() ![]() It is well-known by now that you should not lock a mutex on the audio thread. If, on the other hand, it looks like a relatively quick operation, they might opt for a spinlock instead.īelow, we look at both of those options. If there is a lot of code, they might reach for std::mutex or something similar. It seems that some developers intuitively choose different types of locks depending on the perceived (but often not actually measured) duration of the code under lock. Now (putting aside for a moment the fact that all of these can be implemented without any locks at all if we use more clever data structures), let’s look at the types of locks chosen. You might notice that the only real difference between all those use cases is how large the data structure in question is, and how big the portion of the audio graph is which depends on the current state of that data structure. The audio thread is processing a whole audiograph another thread re-builds this graph.The audio thread is searching for a free polyphonic synthesiser voice that it can use another thread allocates more such voices. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |