Which Notification Mechanism Is Best for High‑Concurrency Message Queues?

This article reviews common notification mechanisms—signal, socket, FIFO, pipe, and eventfd/signalfd—used in high‑performance, lock‑free shared‑memory message queues, comparing their advantages, drawbacks, and suitability for different workload scenarios, and explains why kernel involvement can affect performance and when to prefer each method.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations
Which Notification Mechanism Is Best for High‑Concurrency Message Queues?

High Concurrency Message Queue Notification Mechanisms

Recently I have been researching a high‑performance lock‑free shared‑memory message queue that uses FIFO for notification. Building on the previous article “A Million‑Connection Server Model Based on Pipe Notification”, I summarize the commonly used notification mechanisms.

Typical mechanisms include:

Signal : Send a special signal (e.g., SIGUSR1) to the waiting process, which interrupts its sleep and wakes it. Advantages: no extra eventfd needed; can use real‑time or non‑real‑time signals. Disadvantages: notification is not immediate; signal checking occurs only on interrupt return, depending on OS HZ and jiffies.

Socket : The writer writes a byte to a domain socket; the reader receives a notification via epoll.

FIFO : Similar to socket; the writer writes a byte to a FIFO, and the reader gets notified through epoll.

Pipe : Similar to socket and FIFO.

eventfd/signalfd : Kernel‑assisted FIFO or signal notification, available only in newer kernels. Requires passing handles between processes, making non‑fork implementations more complex.

All these methods share the characteristic that the notifying process must enter kernel mode to deliver the notification. For scenarios with strict performance requirements, minimizing kernel‑mode notifications is advisable. Whether a method is suitable depends on the business scenario and the overhead of sending notifications; if request volume is high and the reader is constantly busy, fewer notifications may be appropriate.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linuxhigh concurrencyMessage Queuenotification mechanisms
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.