[PD] readsf~ and writesf~, locking, blocking and real-time priority
k.s.matheussen at gmail.com
Tue Oct 6 18:15:21 CEST 2015
> My questions are:
> 1) Have I completely misunderstood d_soundfile.c and it is actually
> entirely safe. If so, why is it safe?
It depends whether the OS implements priority inheritance (
I think Windows does something like this, not sure, and perhaps Mac OS X
In Linux, you must call pthread_mutexattr_setprotocol(mutex,
get priority inheritance for your lock. Alternatively, you can just boost
the priority manually before
obtaining the lock, and unboost after releasing.
> 2) Why doesn’t Pd glitch more often when using these objects?
> Probably because the lock is held for so short durations that the OS very
had the chance to interrupt the thread, and for those few times it has
happened, no real time
priority thread had suffered from it, and for those very very very few
times where a realtime priority
thread has suffered, it hadn't suffered enough to cause a glitch.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Pd-list