[Ace-users] Proactor and Thread Pool (TP)

SnakeEyes fernando.fcavalcanti at gmail.com
Fri Feb 8 17:49:55 CST 2008


Hi,

I have something I wanted to implement with Half-Synch/Half-Asynch and
Proactor, but I am not sure how to do it.

I want to have 8 or more UDP sockets open, on groups of 2 per some
class. Each time data is read from the socket, it is decoded and
enqueued on the synchronized queue (SQ) of the Half-Synch part of the
process, where there is one thread assigned to dequeue and process
this data synchronously.

Threads 2, 3 and 4 then can be used concurrently decoding incoming
data from all UDP channels. As I would be using AIO asynch
communication, I wanted Proactor to tell me which socket it just read
data from, then assign a thread to it that would decode this data,
check if it is in sequence and enqueue it or drop it.

I don't understand how I can have one Proactor, 4 (or more) objects
with 2 UDP DGRAM sockets on each, where I proactively request to read
data from all sockets (on all objects) and then 1 or more threads
would get this data from the socket, decode it, check to see if it is
in the right sequence (maybe take a gap filling action) and enqueue
this data on the half-synch part of the process.

I am fairly new to ACE so I am not sure how to implement such a
solution.

Can someone point me to the right examples that would show me how to
do this? I have both C++NB1 and 2, but although I realize that all I
want to do is there, I don't really see how to have the TP in a way
that threads are used automatically by Proactor while there are
Threads available.


More information about the Ace-users mailing list