Dear all,

I'm developing an external that has two threads, one audio thread and one worker thread. The audio thread contains all usual stuff; while the worker thread computes calculations (I need knn searches and so on for my resynthesis) and put them in a data structure. At the end of calculations, the worker thread atomically CAS the data structure.
Actually, I'm using a [readsf~]-like mechanics with pthread signal to communicate between threads.

I would like to remove lock and use a lock free system. I don't know if it feasible. Moreover I don't know if it has some sense, because Pd locks a mutex in scheduler and I don't know if a lock free implementation could be a right solution.

In the case it could be a solution, I will start with a SPSC circular queue and I will use atomic CAS to swap the data structure.

Best regards,

Marco