bgottula / noodles

Framework for DSP flowgraphs.
MIT License
1 stars 0 forks source link

Performance enhancement: use atomic types in RNoodle<T> if T is a primitive type #35

Open jgottula opened 9 years ago

jgottula commented 9 years ago

Do this with template specialization.

If a given instance of RNoodle is using atomic types, then make sure to disable the mutex locking mechanism by making RNoodle::lock() do nothing (i.e. don't set the mgr reference parameter to a unique_lock instance).

See class Noodle at bf862d81c47cac709563f119133a0ed60d13225f for the way we were doing this when everything was an int.

Remember to use the atomic load and store functions in RNoodle::push, RNoodle::pop, RNoodle::peek as appropriate.