diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:21 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:21 +0000 |
commit | 0e49389337be86641451a5c36c24bf742fe97523 (patch) | |
tree | 197c810e5f5bce17b1233a7cb8d7b50c0bcd25e2 /TAO/tao/LF_Strategy.h | |
parent | 8008dd09ccf88d4edef237a184a698cac42f2952 (diff) | |
download | ATCD-0e49389337be86641451a5c36c24bf742fe97523.tar.gz |
Repo restructuring
Diffstat (limited to 'TAO/tao/LF_Strategy.h')
-rw-r--r-- | TAO/tao/LF_Strategy.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/TAO/tao/LF_Strategy.h b/TAO/tao/LF_Strategy.h new file mode 100644 index 00000000000..782821a2542 --- /dev/null +++ b/TAO/tao/LF_Strategy.h @@ -0,0 +1,82 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file LF_Strategy.h + * + * $Id$ + * + * @author Carlos O'Ryan <coryan@uci.edu> + */ +//============================================================================= + +#ifndef TAO_LF_STRATEGY_H +#define TAO_LF_STRATEGY_H + +#include /**/ "ace/pre.h" + +#include "tao/TAO_Export.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "tao/Versioned_Namespace.h" + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL +class ACE_Time_Value; +ACE_END_VERSIONED_NAMESPACE_DECL + +TAO_BEGIN_VERSIONED_NAMESPACE_DECL + +class TAO_Leader_Follower; + +/** + * @brief Strategize Leader/Follower manipulations in the ORB event + * loop. + * + * The ORB event loop must participate in the Leader/Followers + * protocol, but only if that concurrency model is configured, + * otherwise performance suffers. + * + * This class strategizes the ORB behavior in this respect. + */ +class TAO_Export TAO_LF_Strategy +{ +public: + /// Destructor + virtual ~TAO_LF_Strategy (void); + + /// The current thread will handle an upcall + /** + * Threads that handle requests can block for long periods of time, + * causing deadlocks if they don't elect a new leader before + * starting the upcall the system can become non-responsive or + * dead-lock. + */ + virtual void set_upcall_thread (TAO_Leader_Follower &) = 0; + + /// The current thread is entering the reactor event loop + /** + * Threads that block in the reactor event loop become "server" + * threads for the Leader/Follower set. They must be flagged + * specially because they do not wait for one specific event, but + * for any event whatsoever. + */ + virtual int set_event_loop_thread (ACE_Time_Value *max_wait_time, + TAO_Leader_Follower &) = 0; + + /// The current thread is leaving the event loop + /** + * When the thread leaves the event loop a new leader must be + * elected. + */ + virtual void reset_event_loop_thread (int call_reset, + TAO_Leader_Follower &) = 0; +}; + +TAO_END_VERSIONED_NAMESPACE_DECL + +#include /**/ "ace/post.h" + +#endif /* TAO_LF_STRATEGY_H */ |