Introduction
In this blog post, I will compare a multicast message queue which is built by seqlock [1] with a unicast message queue --- MsgQLockFree_1PMC_Linux.
Message queue structure --- MsgQSeqLock_1PMC_Linux
There is only one queue in this message queue. Different thread will have its own header which recorded the next index to read. The underlining is a ring buffer.
This is a special message queue, there is no checking when messages are pushed. The message could be pushed always successfully. Those old message will be dropped automatically.
Those output threads will read all the message and need to process them one by one as this is a multicast message q.
The compare
We compare:
- MsgQSeqLock_1PMC_Linux --- multicast queue
- MsgQLockFree_1PMC_Linux --- unicast queue
This is not a fair compare. I just want to observe the behavior here.
Clearly, both message queues have no influence from multi-threading congestion. The speed of multicast queue is faster which is expected.
Reference
[1]: Rigtorp. (n.d.). GitHub - rigtorp/Seqlock: An implementation of Seqlock in C++11. GitHub. https://github.com/rigtorp/Seqlock
[2]: Meeting Cpp. (2023, January 2). Trading at light speed: designing low latency systems in C++ - David Gross - Meeting C++ 2022 [Video]. YouTube. https://www.youtube.com/watch?v=8uAW5FQtcvE
[3]: LMAX Disruptor. (n.d.). https://lmax-exchange.github.io/disruptor/ --- java multicast queue created by LMAX exchange in London



Comments
Post a Comment