Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

That just sounds like a normal spmc queue as I said above.

Of course they receive the same elements, or it wouldn't be multi-consumer.

Of course producers don't wait for consumers, they don't even need to be aware of how many there are or where they are. But even in a system where you'd know (e.g. publishing data to a bunch a TCP connections), it would he a very bad idea to stall production -- handling back pressure should be application-specific.

You have the same elements in UDP multicast which is the network equivalent, and incidentally the preferred technology for communication in the trading industry, particularly for market data disseminated by exchanges.



Topically in an MC queue, a consumer "consumes" an element and won't be available for other consumers. For example a job queue. Also typically queues either grow unbounded or pushes fail.

So no, I wouldn't say that the disruptor is a normal SPMC or MPMC queue as it semantics are different.

But yes, it has pretty much the same characteristics of UDP.


I see what you mean. I would never use a pattern where you don't broadcast to all consumers myself.

And while you can fail to produce when a consumer is too slow, I'd argue that sort of pattern only makes sense for a single consumer as well (the network equivalent would be TCP, which by definition can only be unicast).


Well, TCP is stream oriented and unicast, but doesn't take much to conceive a message oriented protocol that does anycasting.

As a real world example of anycasting queue that I'm sure you have used, consider the queue behind accept(2) or pthread_condition_wait.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: