LF_Strategy.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file LF_Strategy.h
00006  *
00007  *  LF_Strategy.h,v 1.9 2005/11/24 11:05:45 ossama Exp
00008  *
00009  *  @author Carlos O'Ryan <coryan@uci.edu>
00010  */
00011 //=============================================================================
00012 
00013 #ifndef TAO_LF_STRATEGY_H
00014 #define TAO_LF_STRATEGY_H
00015 
00016 #include /**/ "ace/pre.h"
00017 
00018 #include "tao/TAO_Export.h"
00019 
00020 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00021 # pragma once
00022 #endif /* ACE_LACKS_PRAGMA_ONCE */
00023 
00024 #include "tao/Versioned_Namespace.h"
00025 
00026 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00027 class ACE_Time_Value;
00028 ACE_END_VERSIONED_NAMESPACE_DECL
00029 
00030 TAO_BEGIN_VERSIONED_NAMESPACE_DECL
00031 
00032 class TAO_Leader_Follower;
00033 
00034 /**
00035  * @brief Strategize Leader/Follower manipulations in the ORB event
00036  * loop.
00037  *
00038  * The ORB event loop must participate in the Leader/Followers
00039  * protocol, but only if that concurrency model is configured,
00040  * otherwise performance suffers.
00041  *
00042  * This class strategizes the ORB behavior in this respect.
00043  */
00044 class TAO_Export TAO_LF_Strategy
00045 {
00046 public:
00047   /// Destructor
00048   virtual ~TAO_LF_Strategy (void);
00049 
00050   /// The current thread will handle an upcall
00051   /**
00052    * Threads that handle requests can block for long periods of time,
00053    * causing deadlocks if they don't elect a new leader before
00054    * starting the upcall the system can become non-responsive or
00055    * dead-lock.
00056    */
00057   virtual void set_upcall_thread (TAO_Leader_Follower &) = 0;
00058 
00059   /// The current thread is entering the reactor event loop
00060   /**
00061    * Threads that block in the reactor event loop become "server"
00062    * threads for the Leader/Follower set.  They must be flagged
00063    * specially because they do not wait for one specific event, but
00064    * for any event whatsoever.
00065    */
00066   virtual int set_event_loop_thread (ACE_Time_Value *max_wait_time,
00067                                      TAO_Leader_Follower &) = 0;
00068 
00069   /// The current thread is leaving the event loop
00070   /**
00071    * When the thread leaves the event loop a new leader must be
00072    * elected.
00073    */
00074   virtual void reset_event_loop_thread (int call_reset,
00075                                         TAO_Leader_Follower &) = 0;
00076 };
00077 
00078 TAO_END_VERSIONED_NAMESPACE_DECL
00079 
00080 #include /**/ "ace/post.h"
00081 
00082 #endif  /* TAO_LF_STRATEGY_H */

Generated on Thu Nov 9 11:54:15 2006 for TAO by doxygen 1.3.6