[PD] lock free problem

Marco Matteo Markidis mm.markidis at gmail.com
Tue Aug 23 15:49:20 CEST 2016


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20160823/324de509/attachment.html>


More information about the Pd-list mailing list