ACE  6.2.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes
TP_Reactor.h File Reference
#include "ace/Select_Reactor.h"
#include "ace/Timer_Queue.h"
#include "ace/TP_Reactor.inl"

Classes

class  ACE_EH_Dispatch_Info
 This structure contains information of the activated event handler. More...
 
class  ACE_TP_Token_Guard
 A helper class that helps grabbing, releasing and waiting on tokens for a thread that tries calling handle_events (). More...
 
class  ACE_TP_Reactor
 Specialization of ACE_Select_Reactor to support thread-pool based event dispatching. More...
 

Detailed Description

Id:
TP_Reactor.h 94454 2011-09-08 17:36:56Z johnnyw

The ACE_TP_Reactor (aka, Thread Pool Reactor) uses the Leader/Followers pattern to demultiplex events among a pool of threads. When using a thread pool reactor, an application pre-spawns a fixed number of threads. When these threads invoke the ACE_TP_Reactor's handle_events() method, one thread will become the leader and wait for an event. The other follower threads will queue up waiting for their turn to become the leader. When an event occurs, the leader will pick a follower to become the leader and go on to handle the event. The consequence of using ACE_TP_Reactor is the amortization of the costs used to create threads. The context switching cost will also reduce. Moreover, the total resources used by threads are bounded because there are a fixed number of threads.

Author
Irfan Pyarali irfan.nosp@m.@cs..nosp@m.wustl.nosp@m..edu
Nanbor Wang nanbo.nosp@m.r@cs.nosp@m..wust.nosp@m.l.ed.nosp@m.u