From b7332d34b8fe6be198a24fd8781c4a47d4d09da3 Mon Sep 17 00:00:00 2001 From: sma Date: Wed, 29 Aug 2012 09:42:29 +0000 Subject: Wed Aug 29 09:41:28 UTC 2012 johnny Kokyu/Dispatch_Deferrer.h, Dispatch_Deferrer.inl, Dispatch_Deferrer.cpp: These files have been removed. --- ACE/Kokyu/Dispatch_Deferrer.cpp | 111 ---------------------------------------- ACE/Kokyu/Dispatch_Deferrer.h | 94 ---------------------------------- ACE/Kokyu/Dispatch_Deferrer.inl | 29 ----------- 3 files changed, 234 deletions(-) delete mode 100644 ACE/Kokyu/Dispatch_Deferrer.cpp delete mode 100644 ACE/Kokyu/Dispatch_Deferrer.h delete mode 100644 ACE/Kokyu/Dispatch_Deferrer.inl (limited to 'ACE/Kokyu') diff --git a/ACE/Kokyu/Dispatch_Deferrer.cpp b/ACE/Kokyu/Dispatch_Deferrer.cpp deleted file mode 100644 index 3a5c53470da..00000000000 --- a/ACE/Kokyu/Dispatch_Deferrer.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// $Id$ - -#include "ace/Sched_Params.h" -#include "Dispatch_Deferrer.h" -#include "Dispatcher_Task.h" - -#if ! defined (__ACE_INLINE__) -#include "Dispatch_Deferrer.inl" -#endif /* __ACE_INLINE__ */ - -#include "kokyu_config.h" -#include "kokyu_dsui_families.h" -#include - -namespace Kokyu -{ - -int -Dispatch_Deferrer::init(const Dispatch_Deferrer_Attributes& attr) -{ - //set up reactor for timeouts - this->react_.open(0); - //Don't need any handles, since we're only using it for timeouts - - this->timers_.open(); - - this->task_ = attr.task_; - - return 0; -} - -int -Dispatch_Deferrer::dispatch (Dispatch_Queue_Item *qitem) -{ - ACE_ASSERT(qitem != 0); - - //setup timout - //For now, assume period = deadline - ACE_Time_Value tv; - tv = ACE_OS::gettimeofday() + qitem->qos_info().deadline_; - long timer_id = this->react_.schedule_timer(this, - 0, //NULL arg - tv); - if (timer_id == -1) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("EC (%P|%t) cannot schedule Release Guard timer.") - ACE_TEXT ("ACE_Reactor.schedule_timer() returned -1\n")), - -1); - } - //else valid timer_id - this->timers_.bind(qitem,timer_id); - - //@BT INSTRUMENT with event ID: EVENT_DEFERRED_ENQUEUE Measure time - //between release and enqueue into dispatch queue because of RG - DSUI_EVENT_LOG(DISP_DEFERRER_FAM, EVENT_DEFERRED_ENQUEUE, timer_id, 0, 0); - - //buffer until timer expires - return this->rgq_.enqueue_deadline(qitem,&tv); -} - - -int -Dispatch_Deferrer::handle_timeout (const ACE_Time_Value &, - const void *) -{ - //get all expired Dispatch_Queue_Items - ACE_Message_Block *begin,*end; - this->rgq_.remove_messages(begin,end, - (u_int) (ACE_Dynamic_Message_Strategy::LATE | - ACE_Dynamic_Message_Strategy::BEYOND_LATE)); - - //dispatch them back to Dispatcher_Impl - while (begin <= end) - { - Dispatch_Queue_Item *qitem = - dynamic_cast (begin); - - if (qitem == 0) - { - ACE_Message_Block::release (begin); - continue; - } - - - //remove timer for each enqueued qitem from reactor - long timer_id; - if (this->timers_.find(qitem,timer_id) < 0) - { - ACE_ERROR_RETURN ((LM_ERROR, - ACE_TEXT ("Could not cancel Release Guard timer.") - ACE_TEXT ("Unknown timer ID\n")), - -1); - } - //else got timer_id - this->react_.cancel_timer(timer_id); - - //@BT INSTRUMENT with event ID: EVENT_DEFERRED_DEQUEUE Measure - //time between release and enqueue into dispatch queue because - //of RG - DSUI_EVENT_LOG (DISP_DEFERRER_FAM, EVENT_DEFERRED_DEQUEUE, timer_id, 0, 0); - - this->task_->enqueue(qitem); - - ++begin; - } - - return 0; -} - -} //namespace Kokyu diff --git a/ACE/Kokyu/Dispatch_Deferrer.h b/ACE/Kokyu/Dispatch_Deferrer.h deleted file mode 100644 index 16154402877..00000000000 --- a/ACE/Kokyu/Dispatch_Deferrer.h +++ /dev/null @@ -1,94 +0,0 @@ -/* -*- C++ -*- */ -/** - * @file Dispatch_Deferrer.h - * - * $Id$ - * - * @author Bryan Thrall (thrall@cse.wustl.edu) - * - */ - -#ifndef DISPATCH_DEFERRER_H -#define DISPATCH_DEFERRER_H -#include /**/ "ace/pre.h" - -#if !defined (ACE_LACKS_PRAGMA_ONCE) -# pragma once -#endif /* ACE_LACKS_PRAGMA_ONCE */ - -#include "kokyu_export.h" -#include "Kokyu_defs.h" -#include "ace/Event_Handler.h" -#include "ace/Thread_Mutex.h" -#include "ace/Message_Block.h" -#include "ace/Message_Queue.h" -#include "ace/Reactor.h" -#include "ace/Map_T.h" - -namespace Kokyu -{ - -class Dispatch_Task; //forward decl -class Dispatch_Queue_Item; //forward decl - -/** - * @class Dispatch_Deferrer - * - * @brief Part of the Release Guard protocol. When a Dispatch_Command - * needs to be dispatched later rather than when dispatch_i() is - * called on the Default_Dispatcher_Impl, it is passed to this - * object. When the appropriate time to dispatch the Dispatch_Command - * comes (last release time + period), this object calls enqueue() on - * the Dispatcher_Task. - */ -class Dispatch_Deferrer : public ACE_Event_Handler -{ - public: - Dispatch_Deferrer(); - //Default constructor - - ~Dispatch_Deferrer(); - //Destructor - - int init(const Dispatch_Deferrer_Attributes& attr); - - int dispatch (Dispatch_Queue_Item *qitem); - - virtual int handle_timeout (const ACE_Time_Value ¤t_time, - const void *act = 0); - //TODO: what if need higher resolution timers? - - private: - ACE_Deadline_Message_Strategy msg_strat_; - - ///Stores the Dispatch_Commands in earliest-release-time order, - ///until they are dispatched. I decided to use an - ///ACE_Dynamic_Message_Queue because it supports deadline - ///ordering. This decision is also good because we can simply store - ///the Dispatch_Queue_Item given to us by the - ///Default_Dispatcher_Impl rather than allocate some structure to - ///hold the Dispatch_Command and QoSDescriptor. - ACE_Dynamic_Message_Queue rgq_; - - //Stores timer_ids from the Reactor (longs) using the - //Dispatch_Queue_Item the timer is for as the key. Used to - //cancel timers if they expire and are enqueued before the - //callback happens. - typedef ACE_Map_Manager Timer_Map; - - Timer_Map timers_; - - ///Manages timers for the Dispatch_Commands - ACE_Reactor react_; - - Dispatcher_Task* task_; -}; - -} //namespace Kokyu - -#if defined (__ACE_INLINE__) -#include "Dispatch_Deferrer.inl" -#endif /* __ACE_INLINE__ */ - -#include /**/ "ace/post.h" -#endif //DISPATCH_DEFERRER_H diff --git a/ACE/Kokyu/Dispatch_Deferrer.inl b/ACE/Kokyu/Dispatch_Deferrer.inl deleted file mode 100644 index 315afce5598..00000000000 --- a/ACE/Kokyu/Dispatch_Deferrer.inl +++ /dev/null @@ -1,29 +0,0 @@ -// $Id$ - -namespace Kokyu -{ - -ACE_INLINE -Dispatch_Deferrer_Attributes::Dispatch_Deferrer_Attributes() -{ -} - -ACE_INLINE -Dispatch_Deferrer::Dispatch_Deferrer() - : msg_strat_() - , rgq_(this->msg_strat_) - , timers_() - , react_() - , task_(0) -{ -} - -ACE_INLINE -Dispatch_Deferrer::~Dispatch_Deferrer() -{ - this->react_.close(); - - this->timers_.close(); -} - -} //namespace Kokyu -- cgit v1.2.1