ACE Tutorial 013
Multiple thread pools

My intent with this tutorial was to derive from ACE_Data_Block instead of ACE_Message_Block so that we could leverage the reference counting nature of that object.

Along the way, I sort of got distracted... What I ended up with is a poor excuse for ACE_Stream that implements a simple state machine.

The application is built around a thread pool where the pool's svc() method takes work units from the message queue for processing. As each unit is taken from the queue, the process() method is invoked to do some work. The twist is that after processing the message, we enqueue it into another thread pool to do more work. This continues through a chain of thread pools until the last where the unit's fini() method is called for finishing up any outstanding work.

The chain of thread pools is uni-directional using a singly-linked list of Task derivatives. Each pool has the same number of tasks in order to keep things simple.

Kirthika's abstract:

[Tutorial Index] [Continue This Tutorial]