3 //=============================================================================
7 * @author Carlos O'Ryan <coryan@uci.edu>
9 //=============================================================================
11 #ifndef TAO_LF_STRATEGY_H
12 #define TAO_LF_STRATEGY_H
14 #include /**/ "ace/pre.h"
16 #include /**/ "tao/TAO_Export.h"
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
22 #include /**/ "tao/Versioned_Namespace.h"
24 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
26 ACE_END_VERSIONED_NAMESPACE_DECL
28 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
30 class TAO_Leader_Follower
;
33 * @brief Strategize Leader/Follower manipulations in the ORB event
36 * The ORB event loop must participate in the Leader/Followers
37 * protocol, but only if that concurrency model is configured,
38 * otherwise performance suffers.
40 * This class strategizes the ORB behavior in this respect.
42 class TAO_Export TAO_LF_Strategy
46 virtual ~TAO_LF_Strategy ();
48 /// The current thread will handle an upcall
50 * Threads that handle requests can block for long periods of time,
51 * causing deadlocks if they don't elect a new leader before
52 * starting the upcall the system can become non-responsive or
55 virtual void set_upcall_thread (TAO_Leader_Follower
&) = 0;
57 /// The current thread is entering the reactor event loop
59 * Threads that block in the reactor event loop become "server"
60 * threads for the Leader/Follower set. They must be flagged
61 * specially because they do not wait for one specific event, but
62 * for any event whatsoever.
64 virtual int set_event_loop_thread (ACE_Time_Value
*max_wait_time
,
65 TAO_Leader_Follower
&) = 0;
67 /// The current thread is leaving the event loop
69 * When the thread leaves the event loop a new leader must be
72 virtual void reset_event_loop_thread (int call_reset
,
73 TAO_Leader_Follower
&) = 0;
76 TAO_END_VERSIONED_NAMESPACE_DECL
78 #include /**/ "ace/post.h"
80 #endif /* TAO_LF_STRATEGY_H */