Andres Freund <and...@anarazel.de> writes: > These separate shm_mq instances forward messages in a circle, > "leader"->worker_1->worker_2->...->"leader". So there isn't a single contended > spinlock, but a bunch of different spinlocks, each with at most two backends > accessing it?
No; there's just one spinlock. I'm re-purposing the spinlock that test_shm_mq uses to protect its setup operations (and thereafter ignores). AFAICS the N+1 shm_mq instances don't internally contain spinlocks; they all use atomic ops. (Well, on crappy architectures maybe there's spinlocks underneath the atomic ops, but I don't think we care about such cases here.) regards, tom lane