ACE Tutorial 010
Passing chunks of data through an ACE_Message_Queue

In an earlier tutorial we briefly introduced ACE_Message_Queue. In this tutorial we'll go into a bit more detail.

ACE_Message_Queue is modeled after Unix System V IPC mechanisms. The basic idea is that you put a block of data into one end of the Queue and take it out of the other end. Your basic FIFO in other words. The SysV mechanism works great for passing these blocks of data between processes on the same host but it's a bit overkill for moving blocks between threads. You could use a pipe, socket or similar mechanism but that still has more overhead than we really want just for moving data between threads. Process-global memory is a good technique but then you need a way to signal the "listening" threads. The ACE_Message_Queue is a better approach: Create blocks of data and enqueue them in one thread while another thread (or threads) dequeue and perform work.

Kirthika's Abstract:

[Tutorial Index] [Continue This Tutorial]