Re: AOO plugin for PD on SGI Irix

Christof Ressi via Pd-list <[email protected]> Mon, 20 Jul 2026 15:38:15 +0900
Newsgroups gmane.comp.multimedia.puredata.general
Message-ID <[email protected]>
> That works now for me without clicks and crackling.
Good that you found a workaround!

Just keep in mind that this doesn't fix the underlying issue, namely 
that the process() method can't take a reader lock.

As I said, the network threads only take reader locks, so they should 
never block the process() method. The methods that do take a writer lock 
are never called in parallel with the process() method, at least not in 
the Pd version.

I see two potential problems:

1. I made a mistake somewhere and accidentally take a writer lock. I 
don't think this is the case. I checked every lock of update_mutex in 
aoo/src/source.cpp and everything looks fine. Also, if there really was 
a problem with the code, it should affect every platform, not only SGI.

2. The aoo::shared_mutex implementation is broken on SGI.

Actually, aoo::shared_mutex has several implementations. On SGI it 
should use pthread_rwlock if available, or fall back to 
std::shared_mutex otherwise. Can you check if AOO_HAVE_PTHREAD_RWLOCK is 
defined resp. check the value of the (internal) AOO_HAVE_PTHREAD_RWLOCK 
CMake cache variable?

Christof

On 7/19/2026 7:43 PM, Wolfgang Gaggl via Pd-list wrote:
> ...sent that last reply to quickly.
> added a poor-mans pause_cpu() implementation for the above lock retry case:
> inline void pause_cpu() {
> #if defined(_MSC_VER)
>      YieldProcessor();
> #elif defined(__SSE2__)
>      _mm_pause();
> #elif defined(__aarch64__)
>      __asm__ __volatile__("isb");
> #elif defined(__arm__)
>      __asm__ __volatile__("yield");
> #elif defined(__mips__)
> # if (defined(_MIPS_ARCH_MIPS32R2) || defined(_MIPS_ARCH_MIPS64R2)) || \
>       (defined(__mips_isa_rev) && __mips_isa_rev >= 2)
>      // MIPS32r2+: PAUSE instruction (architectural spin-loop hint)
>      __asm__ __volatile__(".set push\n\t"
>                           ".set mips32r2\n\t"
>                           "pause\n\t"
>                           ".set pop");
> # else
>      // MIPS4 / R10000 / R12000: SSNOP (SuperScalar NO-OP)
>      // Encoding: sll $0,$0,1  (sa=1 distinguishes SSNOP from plain NOP sa=0)
>      // Writing to $0 is a no-op data-wise; the sa=1 field tells the CPU not to
>      // dual-issue the following instruction, reducing bus pressure in spin loops.
>      __asm__ __volatile__("sll $0,$0,1");
> # endif
>
> That works now for me without clicks and crackling.
> ---
> [email protected] - the Pure Data mailinglist
> https://lists.iem.at/hyperkitty/list/[email protected]/message/FLHJJLJIH5ZOABTCT6QMQ3J6V3JQVBWU/
>
> To unsubscribe send an email to [email protected] mailing list
> UNSUBSCRIBE and account-management -> https://lists.iem.at/
>

---
[email protected] - the Pure Data mailinglist
https://lists.iem.at/hyperkitty/list/[email protected]/message/WMM46LFFTQ3MQQGODNMGLJZXW6PBLSHE/

To unsubscribe send an email to [email protected] mailing list
UNSUBSCRIBE and account-management -> https://lists.iem.at/