diff options
93 files changed, 14876 insertions, 131 deletions
diff --git a/TAO/ChangeLog-98c b/TAO/ChangeLog-98c index 0f63c853320..675df549ede 100644 --- a/TAO/ChangeLog-98c +++ b/TAO/ChangeLog-98c @@ -1,3 +1,22 @@ +Wed Dec 10 20:13:57 1997 Carlos O'Ryan <coryan@macarena.cs.wustl.edu> + + * Makefile: + Added orbsvcs to the hierarchy. + + * The orbsvcs directory was completely reorganized, in preparation + for its official release. The new hierarchy is: + - orbsvcs/orbsvcs: Contains a library with: + + The client stubs for the services. + + Common utility classes to access the services. + + The server skeletons, but not their implementation. + - orbsvcs/Naming_Service: the COSS Naming Service. + - orbsvcs/Scheduling_Service: TAO Real-Time Scheduling Service. + - orbsvcs/Event_Service: TAO Real-Time Event Service. + - orbsvcs/tests: test programs and examples. + + * docs/releasenotes/index.html: + Updated documentation on the Event Service and its friends. + Wed Dec 10 19:57:07 1997 Chris Cleeland <cleeland@cs.wustl.edu> * tests/Cubit/TAO/IDL_Cubit/cubit_i.cpp (Cubit_i::cube_sequence): diff --git a/TAO/Makefile b/TAO/Makefile index b7a48015abd..05970883f13 100644 --- a/TAO/Makefile +++ b/TAO/Makefile @@ -13,12 +13,14 @@ INFO = README \ DIRS = tao \ TAO_IDL \ + orbsvcs \ tests CLONE = Makefile \ tao \ TAO_IDL \ + orbsvcs \ tests \ #---------------------------------------------------------------------------- @@ -51,6 +53,7 @@ RELEASE_FILES = TAO/ChangeLog \ TAO/README.sun \ TAO/tao \ TAO/TAO_IDL \ + TAO/orbsvcs \ TAO/tests \ TAO/VERSION diff --git a/TAO/docs/releasenotes/index.html b/TAO/docs/releasenotes/index.html index c84985e00cd..39ed95d3020 100644 --- a/TAO/docs/releasenotes/index.html +++ b/TAO/docs/releasenotes/index.html @@ -193,7 +193,8 @@ the Real-time "Scheduling Service", which now has an IDL interface.</LI> At run-time (no config runs) there is no need to use the Real-time Scheduling Service, a faster, collocated implementation for the service is available. Obviously the information is generated on the config runs and linked into -the program.</LI> +the program. Unfortunately the schedule information cannot be +downloaded from the service right now.</LI> <LI> TAO <A HREF="#naming">Naming Service</A> is used to locate the various @@ -232,7 +233,35 @@ persistent form, so startup cost are lower too.</LI> </UL> - +<P>For general documentation on the Event Service please read +<A HREF="http://www.cs.wustl.edu/~schmidt/oopsla.ps.gz"> +The Design and Performance of a Real-time CORBA Event Service</A>. + +The current distribution has just one test program for the Event +Service, below are the basic instructions to run it:</P> + +<OL> +<LI> Compile everything under <CODE>$TAO_ROOT/orbsvcs</CODE>, this + needs, obviously, <CODE>$TAO_ROOT/tao</CODE> and + the IDL compiler in <CODE>$TAO_ROOT/TAO_IDL</CODE>. + You have to add <CODE>config=1</CODE> to your make invocation, + this is needed to force the usage of a global scheduling + service, + currently the collocated, precomputed scheduler cannot be used + since the global scheduler cannot be dumped.</LI> + +<LI> Run the naming service, the scheduling service, the event service + and the test in + <CODE>$TAO_ROOT/TAO/orbsvcs/tests/Event_Latency</CODE>; + remember to give a different port to each one, + using the <CODE>-ORBport</CODE> option.</LI> + +<LI> If you want real-time behavior on Solari you may need to run + this programs as root; on the other hand, this particular + example really has no priority inversion, since only one + thread runs at a time.</LI> + +</OL> <HR> <H3> diff --git a/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp new file mode 100644 index 00000000000..db6d7736026 --- /dev/null +++ b/TAO/orbsvcs/Dump_Schedule/Dump_Schedule.cpp @@ -0,0 +1,63 @@ +// +// $Id$ +// + +#include "ace/Sched_Params.h" +#include "ace/Get_Opt.h" +#include "tao/corba.h" + +#include "orbsvcs/CosNamingC.h" +#include "orbsvcs/Scheduler_Factory.h" + +// This program dumps the results of one scheduling in a C++ file. + + + +int main (int argc, char *argv[]) +{ + ACE_TRY + { + // Initialize ORB. + CORBA::ORB_ptr orb = + CORBA::ORB_init (argc, argv, "dump_schedule", ACE_TRY_ENV); + ACE_CHECK_ENV; + + CORBA::POA_ptr poa = + orb->POA_init(argc, argv, "POA"); + if (poa == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + } + + CORBA::Object_ptr objref = + orb->resolve_initial_references ("NameService"); + ACE_CHECK_ENV; + CosNaming::NamingContext_var naming_context = + CosNaming::NamingContext::_narrow (objref, ACE_TRY_ENV); + ACE_CHECK_ENV; + + ACE_Scheduler_Factory::use_config (naming_context.ptr ()); + + RtecScheduler::RT_Info_Set* infos; + ACE_Scheduler_Factory::server ()->compute_scheduling + (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, + ACE_SCOPE_THREAD), + ACE_Sched_Params::priority_max (ACE_SCHED_FIFO, + ACE_SCOPE_THREAD), + infos, ACE_TRY_ENV); + ACE_CHECK_ENV; + + ACE_Scheduler_Factory::dump_schedule (*infos, + "Scheduler_Runtime.cpp"); + delete infos; + } + ACE_CATCH (CORBA::SystemException, sys_ex) + { + ACE_TRY_ENV.print_exception ("SYS_EX"); + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/orbsvcs/Dump_Schedule/Makefile b/TAO/orbsvcs/Dump_Schedule/Makefile new file mode 100644 index 00000000000..d2cb9f84bd5 --- /dev/null +++ b/TAO/orbsvcs/Dump_Schedule/Makefile @@ -0,0 +1,223 @@ +# +# $Id$ +# + +BIN = Dump_Schedule +BUILD = $(BIN) + +DUMP_SRCS = \ + Dump_Schedule.cpp + +LSRC = $(DUMP_SRCS) + +SCHEDULE_OBJS=$(SCHEDULE_SRCS:.cpp=.o) +DUMP_OBJS=$(DUMP_SRCS:.cpp=.o) + +LDLIBS = -lorbsvcs -lTAO +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +#include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif +TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE +DCFLAGS = -g +LDFLAGS += -L$(TAO_ROOT)/orbsvcs/orbsvcs -L$(TAO_ROOT)/tao +CPPFLAGS += -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H + +Dump_Schedule: $(addprefix $(VDIR),$(DUMP_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) + + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +.obj/Dump_Schedule.o .shobj/Dump_Schedule.: Dump_Schedule.cpp \ + $(ACE_ROOT)/ace/Sched_Params.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Sched_Params.i \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.i + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/bin/Naming_Service/svc.conf b/TAO/orbsvcs/Dump_Schedule/svc.conf index 43c6a486c92..43c6a486c92 100644 --- a/TAO/orbsvcs/bin/Naming_Service/svc.conf +++ b/TAO/orbsvcs/Dump_Schedule/svc.conf diff --git a/TAO/orbsvcs/Event_Service/BCU.cpp b/TAO/orbsvcs/Event_Service/BCU.cpp new file mode 100644 index 00000000000..862f6240cdc --- /dev/null +++ b/TAO/orbsvcs/Event_Service/BCU.cpp @@ -0,0 +1,31 @@ +// $Id$ + +#include "BCU.h" +#include "ace/ACE.h" + + +u_long +ACE_BCU (u_long n) +{ + const u_long ACE_BCU_PRIME_NUMBER = 9619; + + u_long retval = 0; + + while (n-- > 0) + retval = ACE::is_prime (ACE_BCU_PRIME_NUMBER, 2, ACE_BCU_PRIME_NUMBER / 2); + + return retval; +} + + +u_long +ACE_BCU (u_long number, + u_long n) +{ + u_long retval = 0; + + while (n-- > 0) + retval = ACE::is_prime (number, 2, number); + + return retval; +} diff --git a/TAO/orbsvcs/Event_Service/BCU.h b/TAO/orbsvcs/Event_Service/BCU.h new file mode 100644 index 00000000000..9eaf5fdf96b --- /dev/null +++ b/TAO/orbsvcs/Event_Service/BCU.h @@ -0,0 +1,35 @@ +/* -*- C++ -*- */ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// ace ORB +// +// = FILENAME +// Benchmark Computation Units +// +// = AUTHOR +// David Levine and Tim Harrison (harrison@cs.wustl.edu) +// +// = DESCRIPTION +// +// Times how long it takes to generate each of the first N prime +// numbers. +// ============================================================================ + +#if !defined (ACE_BCU_H) +#define ACE_BCU_H + +#include "ace/OS.h" + + +u_long ACE_BCU (u_long n); +// Check if a specific, hardcoded number is prime (via ACE::is_prime) <n> +// times. + + +u_long ACE_BCU (u_long number, u_long n); +// Check if <number> is prime (via ACE::is_prime ()) <n> times. + +#endif /* ACE_BCU_H */ diff --git a/TAO/orbsvcs/Event_Service/CORBA_Utils_T.cpp b/TAO/orbsvcs/Event_Service/CORBA_Utils_T.cpp new file mode 100644 index 00000000000..f603421eaaa --- /dev/null +++ b/TAO/orbsvcs/Event_Service/CORBA_Utils_T.cpp @@ -0,0 +1,349 @@ +// $Id$ + +#if !defined (ACE_CORBA_UTILS_C) +#define ACE_CORBA_UTILS_C + +#include "CORBA_Utils_T.h" +#include "ace/Log_Msg.h" + +#if !defined (__ACE_INLINE__) +#include "CORBA_Utils_T.i" +#endif /* __ACE_INLINE__ */ + +template <class TYPE> +ACE_CORBA_Sequence<TYPE>::ACE_CORBA_Sequence (const ACE_CORBA_Sequence<TYPE> &source) + : maximum_ (0), + length_ (0), + buffer_ (0), + release_ (0) +{ + (*this) = source; +} + +template <class TYPE> +ACE_CORBA_Sequence<TYPE>::ACE_CORBA_Sequence (void) + : maximum_ (0), + length_ (0), + buffer_ (0), + release_ (0) +{ +} + +template <class TYPE> +ACE_CORBA_Sequence<TYPE>::~ACE_CORBA_Sequence (void) +{ + if (release_) + { + this->delete_array (buffer_, maximum_); + } +} + +template <class TYPE> +ACE_CORBA_Sequence<TYPE>::ACE_CORBA_Sequence (CORBA::ULong max) + : maximum_ (max), + length_ (0), + buffer_ (0), + + release_ (0) +{ + if (maximum_ > 0) + { + buffer_ = this->new_array (maximum_); + release_ = 1; + } +} + +template <class TYPE> TYPE * +ACE_CORBA_Sequence<TYPE>::new_array (size_t len) +{ + return new TYPE[len]; +} + +template <class TYPE> void +ACE_CORBA_Sequence<TYPE>::delete_array (TYPE *buf, size_t) +{ + delete [] buf; +} + +template <class TYPE> +ACE_CORBA_Sequence<TYPE>::ACE_CORBA_Sequence (CORBA::ULong max, + CORBA::ULong length, + TYPE* data, + CORBA::Boolean release) + : maximum_ (max), + length_ (length), + buffer_ (data), + release_ (release) +{ + if ((buffer_ == 0) && (max > 0)) + { + // @@ What should we do here? + errno = ENOMEM; + ACE_ERROR ((LM_ERROR, "No memory.\n")); + } +} + +// @@ This makes a deep copy, dig? +template <class TYPE> ACE_CORBA_Sequence<TYPE> & +ACE_CORBA_Sequence<TYPE>::operator= (const ACE_CORBA_Sequence<TYPE> &source) +{ + if (source.length () > 0) + { + // If our buffer is too small, release it and allocate one just big + // enough. If buffer_ == 0, this works fine. + if (this->maximum () < source.length ()) + { + if (release_) + { + this->delete_array (buffer_, maximum_); + } + maximum_ = source.length (); + buffer_ = this->new_array (maximum_); + release_ = 1; + } + + // Copy each of the items from the source. + for (CORBA::ULong index=0; index < source.length (); index++) + (*this)[index] = source[index]; + + this->length (source.length ()); + } + + return *this; +} + +template <class TYPE> void +ACE_CORBA_Sequence<TYPE>::length (CORBA::ULong len) +{ + if (len > maximum_) + { + // Allocate the space that we need. + TYPE* tmp = this->new_array (len); + // Copy over the old sequence. + for (int i = 0; i < maximum_; ++i) + { + tmp[i] = buffer_[i]; + } + if (release_) + { + this->delete_array (buffer_, maximum_); + } + buffer_ = tmp; + release_ = 1; + maximum_ = len; + // The destructor of -old- will release the old buffer_ if + // necessary. + } + + length_ = len; +} + + +// g++ can't handle these operator [] functions if they're inline +template <class TYPE> TYPE& +ACE_CORBA_Sequence<TYPE>::operator [] (CORBA::ULong i) +{ + // @@ Should we do bounds checking? + if (i >= maximum_) + { + ACE_ERROR ((LM_ERROR, "Trying to write past maximum.\n")); + return buffer_[maximum_ - 1]; + } + else + return buffer_[i]; +} + +template <class TYPE> const TYPE& +ACE_CORBA_Sequence<TYPE>::operator [] (CORBA::ULong i) const +{ + if (i >= length_) + { + ACE_ERROR ((LM_ERROR, "Trying to read past length.\n")); + return buffer_[length_ - 1]; + } + + return buffer_[i]; +} + +// ******************** + +/* +template <class TYPE> void +dump (const ACE_CORBA_Sequence<TYPE> &seq) +{ + for (CORBA::ULong index=0; index < seq.length (); index++) + dump (seq[index]); +} +*/ + +/* +template <class TYPE> ACE_INLINE void +operator += (ACE_CORBA_Sequence<TYPE> &seq, + const TYPE &item) +{ + CORBA::ULong length = seq.length (); + seq.length (length + 1); + seq[length] = item; +} +*/ + +template <class TYPE> ACE_INLINE void +operator += (ACE_CORBA_Sequence<TYPE> &dest, + const ACE_CORBA_Sequence<TYPE> &source) +{ + int old_length = dest.length (); + int new_length = old_length + source.length (); + dest.length (new_length); + + int difference = new_length - old_length; + + for (int x=0; x < difference; x++) + dest[old_length + x] = source[x]; +} + +/* +template <class TYPE> ACE_INLINE void +remove_item (TYPE &seq, CORBA::ULong index) +{ + int new_length = seq.length () - 1; + + // Shift the set back one, starting at <index>. + for (int x = index; x < new_length; x++) + seq[x] = seq[x+1]; + + // Set the new length. + seq.length (new_length); +} +*/ + +// ************************************************************ +// ************************************************************ +// ************************************************************ + +template<class TYPE> +ACE_CORBA_var<TYPE>::ACE_CORBA_var (const ACE_CORBA_var<TYPE> &source) +{ + if (source.me_ != 0) + me_ = (TYPE *) source.me_->_duplicate (); + // CORBA::duplicate (source.me_); +} + +template<class TYPE> +ACE_CORBA_var<TYPE>::ACE_CORBA_var (void) + : me_ (0) +{ +} + +template<class TYPE> +ACE_CORBA_var<TYPE>::ACE_CORBA_var (TYPE *source) +{ + me_ = (TYPE *) source->_duplicate (); + // CORBA::duplicate (source); +} + +template<class TYPE> +ACE_CORBA_var<TYPE>::~ACE_CORBA_var (void) +{ + if (me_ != 0) + me_->_release (); + //CORBA::release (me_); +} + +template<class TYPE> ACE_CORBA_var<TYPE> & +ACE_CORBA_var<TYPE>::operator= (TYPE *source) +{ + if (me_ != source && + me_ != 0) + me_->_release (); + //CORBA::release (me_); + + me_ = (TYPE *) source->_duplicate (); + // CORBA::duplicate (source); + return *this; +} + +template<class TYPE> ACE_CORBA_var<TYPE> & +ACE_CORBA_var<TYPE>::operator= (const ACE_CORBA_var<TYPE> &source) +{ + if (me_ != source.me_ && + me_ != 0) + me_->_release (); + // CORBA::release (me_); + + me_ = (TYPE *) source.me_->_duplicate (); + // CORBA::duplicate (source.me_); + return *this; +} + +template<class TYPE> TYPE * +ACE_CORBA_var<TYPE>::operator->(void) +{ + return me_; +} + +template<class TYPE> +ACE_CORBA_var<TYPE>::operator TYPE *(void) const +{ + return me_; +} + +/* +template<class TYPE> +ACE_CORBA_var<TYPE>::operator TYPE *&(void) +{ + return me_; +} +*/ + +template<class TYPE> +ACE_CORBA_var<TYPE>::operator TYPE &(void) const +{ + return *me_; +} + +// ************************************************************ +// ************************************************************ + +/* +ACE_CORBA_Object_Ref<IMPL>::ACE_CORBA_Object_Ref (void) + : impl_ (0) +{ +} + +ACE_CORBA_Object_Ref<IMPL>::ACE_CORBA_Object_Ref (IMPL *impl) + : impl_ (impl) +{ +} + +ACE_CORBA_Object_Ref<IMPL>::~ACE_CORBA_Object_Ref (void) + : impl_ (0) +{ +} + +ACE_CORBA_Object_Ref<IMPL> & +ACE_CORBA_Object_Ref<IMPL>::operator= (const ACE_CORBA_Object_Ref<IMPL> &source) +{ + return *this; +} + +IMPL * +ACE_CORBA_Object_Ref<IMPL>::operator->(void) +{ + return impl_; +} + +IMPL * +ACE_CORBA_Object_Ref<IMPL>::operator IMPL *(void) +{ + return impl_; +} + +ACE_CORBA_Object_Ref<IMPL> * +ACE_CORBA_Object_Ref<IMPL>::_duplicate (ACE_CORBA_Object_Ref<IMPL> *source) +{ + source->ref_count_++; + return source; +} + +*/ +#endif /* ACE_CORBA_UTILS_C */ diff --git a/TAO/orbsvcs/Event_Service/CORBA_Utils_T.h b/TAO/orbsvcs/Event_Service/CORBA_Utils_T.h new file mode 100644 index 00000000000..8abf180d9e1 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/CORBA_Utils_T.h @@ -0,0 +1,236 @@ +/* -*- C++ -*- */ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// ace_orb +// +// = FILENAME +// CORBA_Utilities.h +// +// = AUTHORS +// Tim Harrison. +// +// = NOTE +// This class is a bit ackward when using a real ORB, but we cannot +// easily remove it since some of the types are used in the +// implementation of the EC. TODO +// +// ============================================================================ + +#if !defined (ACE_CORBA_UTILS_H) +#define ACE_CORBA_UTILS_H + +#include "ace/Time_Value.h" +#include "tao/corba.h" + +template <class TYPE> +class ACE_CORBA_Sequence// : public CORBA::Object +// = TITLE +// +// = DESCRIPTION +{ +public: + + ACE_CORBA_Sequence (const ACE_CORBA_Sequence<TYPE> &source); + // Copy construction. + + ACE_CORBA_Sequence (CORBA::ULong max); + ACE_CORBA_Sequence (CORBA::ULong max, + CORBA::ULong length, + TYPE* data, + CORBA::Boolean release = 0); + ACE_CORBA_Sequence (void); + + virtual ~ACE_CORBA_Sequence (void); + + ACE_CORBA_Sequence<TYPE> &operator= (const ACE_CORBA_Sequence<TYPE> &); + + // static TYPE* allocbuf(CORBA::ULong nelems); + // static void freebuf(TYPE* data); + + CORBA::ULong maximum (void) const; + CORBA::ULong length (void) const; + void length (CORBA::ULong len); + + TYPE& operator [] (CORBA::ULong IT_i); + + const TYPE& operator [] (CORBA::ULong IT_i) const; + + virtual TYPE *new_array (size_t len); + // Allocates TYPE[len]. This facilitates template methods through + // template specialization to allow the use of different memory + // pools. + + virtual void delete_array (TYPE *buf, size_t len); + // delete [] <buf>. + +protected: + CORBA::ULong maximum_; + CORBA::ULong length_; + TYPE* buffer_; + unsigned char release_; +}; + +// Utility for debugging sequences. +//template <class TYPE> +//void dump (const ACE_CORBA_Sequence<TYPE> &seq); + +// Utility for appending single items. Increases the length of <set> +// and adds <event> to the end of <set>. +template <class TYPE> void +operator += (ACE_CORBA_Sequence<TYPE> &seq, + const TYPE &item) +{ + CORBA::ULong length = seq.length (); + seq.length (length + 1); + seq[length] = item; +} + +// Utility for appending sequences. +template <class TYPE> void +operator += (ACE_CORBA_Sequence<TYPE> &dest, + const ACE_CORBA_Sequence<TYPE> &source); + +template <class TYPE> void +remove_item (TYPE &seq, CORBA::ULong index) +{ + int new_length = seq.length () - 1; + + // Shift the set back one, starting at <index>. + for (int x = index; x < new_length; x++) + seq[x] = seq[x+1]; + + // Set the new length. + seq.length (new_length); +} +// Removes seq[index] by moving everything after <index> back and +// decrementing the length. + +// ************************************************************ + +template <class TYPE> +class ACE_CORBA_var +// = TITLE +// +// = DESCRIPTION +{ +public: + ACE_CORBA_var (const ACE_CORBA_var<TYPE> &source); + ACE_CORBA_var (void); + ACE_CORBA_var (TYPE *source); + ~ACE_CORBA_var (void); + ACE_CORBA_var<TYPE> &operator= (TYPE *source); + ACE_CORBA_var<TYPE> &operator= (const ACE_CORBA_var<TYPE> &source); + TYPE *operator->(void); + operator TYPE *(void) const; + // operator TYPE *&(void); + operator TYPE &(void) const; +private: + TYPE *me_; +}; + +// ************************************************************ + +/* +template <class IMPL> +class ACE_CORBA_Object_Ref : public CORBA::Object +// = TITLE +// ACE CORBA Object Reference +// +// = DESCRIPTION +// A wrapper for making CORBA Object References. For a single +// address space ORB, this points directly to the IMPL +// class. This is supposed to look like a pointer to +// IMPL with an additional static _duplicate method. +{ +public: + // ACE_CORBA_Object_Ref (ACE_CORBA_Object_Ref<IMPL> &obj); + ACE_CORBA_Object_Ref (void); + ACE_CORBA_Object_Ref (IMPL *impl); + ~ACE_CORBA_Object_Ref (void); + // ACE_CORBA_Object_Ref<IMPL> &operator= (IMPL *source); + ACE_CORBA_Object_Ref<IMPL> &operator= + (const ACE_CORBA_Object_Ref<IMPL> &source); + + IMPL *operator->(void); + // A distributed ORB would require that the CORBA Object Reference + // implement all IMPL interfaces, marshall the parameters, + // and transmit over IIOP. For this single address space ORB, we'll + // just delegate method calls to the IMPL directly. + + operator IMPL *(void) const; + // operator IMPL *&(void); + // operator IMPL &(void) const; + + static ACE_CORBA_Object_Ref<IMPL> *_duplicate + (ACE_CORBA_Object_Ref<IMPL> *source); + +private: + IMPL *impl_; +}; +*/ + +// ************************************************************ + +template <class ITEM, size_t SIZE> +class ACE_ES_Simple_Array +// = TITLE +// Simple Array +// +// = DESCRIPTION +// Wraps ITEM[SIZE] with insert and an iterator. There is no +// remove. It allows duplicates. It is truly very simple. +{ + public: + ACE_ES_Simple_Array (void); + int insert (const ITEM ©_me); + size_t size (void); + ITEM *data (void); + protected: + ITEM data_[SIZE]; + size_t size_; +}; + +template <class ITEM> +class ACE_ES_Array_Iterator +// = TITLE +// Simple Iterator +// +// = DESCRIPTION +// Iterates through an array of ITEMs. +{ +public: + ACE_ES_Array_Iterator (ITEM *data, size_t size); + + int next (ITEM *&next_item); + // Returns 0 when all items have been seen, else 1. Sets + // <next_item> to point at the next ITEM. + + int advance (void); + // Move forward by one element in the Stack. Returns 0 when all the + // items in the Stack have been seen, else 1. + + int done (void) const; + // Returns 1 when all items have been seen, else 0. + +private: + ITEM *data_; + size_t size_; + size_t index_; +}; + +#if defined (__ACE_INLINE__) +#include "CORBA_Utils_T.i" +#endif /* __ACE_INLINE__ */ + +#if defined (ACE_TEMPLATES_REQUIRE_SOURCE) +#include "CORBA_Utils_T.cpp" +#endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ + +#if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) +#pragma implementation ("CORBA_Utils_T.cpp") +#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */ + +#endif /* ACE_CORBA_UTILS_H */ diff --git a/TAO/orbsvcs/Event_Service/CORBA_Utils_T.i b/TAO/orbsvcs/Event_Service/CORBA_Utils_T.i new file mode 100644 index 00000000000..b31b093baf2 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/CORBA_Utils_T.i @@ -0,0 +1,70 @@ +/* -*- C++ -*- */ +// $Id$ + +template <class TYPE> ACE_INLINE CORBA::ULong +ACE_CORBA_Sequence<TYPE>::maximum (void) const +{ + return maximum_; +} + +template <class TYPE> ACE_INLINE CORBA::ULong +ACE_CORBA_Sequence<TYPE>::length() const +{ + return length_; +} + + +// ************************************************************ + +template <class ITEM, size_t SIZE> ACE_INLINE +ACE_ES_Simple_Array<ITEM, SIZE>::ACE_ES_Simple_Array (void) : + size_ (0) +{ +} + +template <class ITEM, size_t SIZE> ACE_INLINE int +ACE_ES_Simple_Array<ITEM, SIZE>::insert (const ITEM ©_me) +{ + if (size_ >= SIZE) + return -1; + + data_[size_++] = copy_me; + return 0; +} + +template <class ITEM, size_t SIZE> ACE_INLINE size_t +ACE_ES_Simple_Array<ITEM, SIZE>::size (void) +{ + return size_; +} + +template <class ITEM, size_t SIZE> ACE_INLINE ITEM * +ACE_ES_Simple_Array<ITEM, SIZE>::data (void) +{ + return data_; +} + +// ************************************************************ + +template <class ITEM> ACE_INLINE +ACE_ES_Array_Iterator<ITEM>::ACE_ES_Array_Iterator (ITEM *data, size_t size) : + data_ (data), + size_ (size), + index_ (0) +{ +} + +template <class ITEM> ACE_INLINE int +ACE_ES_Array_Iterator<ITEM>::next (ITEM *&next_item) +{ + next_item = &data_[index_]; + return index_ < (size_ - 1); +} + +template <class ITEM> ACE_INLINE int +ACE_ES_Array_Iterator<ITEM>::advance (void) +{ + index_++; + return index_ < size_; +} + diff --git a/TAO/orbsvcs/Event_Service/Channel_Clients.i b/TAO/orbsvcs/Event_Service/Channel_Clients.i new file mode 100644 index 00000000000..6318deb79a0 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Channel_Clients.i @@ -0,0 +1,2 @@ +/* -*- C++ -*- */ +// $Id$ diff --git a/TAO/orbsvcs/Event_Service/Channel_Clients_T.i b/TAO/orbsvcs/Event_Service/Channel_Clients_T.i new file mode 100644 index 00000000000..f7c0760fd86 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Channel_Clients_T.i @@ -0,0 +1,35 @@ +/* -*- C++ -*- */ +// $Id$ + +template <class TARGET> ACE_INLINE +ACE_PushConsumer_Adapter<TARGET>::ACE_PushConsumer_Adapter (TARGET *target) + : target_ (target) +{ +} + +template <class TARGET> ACE_INLINE void +ACE_PushConsumer_Adapter<TARGET>::push (const RtecEventComm::EventSet& events, + CORBA::Environment &_env) +{ + target_->_push (events, _env); +} + +template <class TARGET> ACE_INLINE void +ACE_PushConsumer_Adapter<TARGET>::disconnect_push_consumer (CORBA::Environment &_env) +{ + target_->_disconnect_push_consumer (_env); +} + +// ************************************************************ + +template <class TARGET> ACE_INLINE +ACE_PushSupplier_Adapter<TARGET>::ACE_PushSupplier_Adapter (TARGET *target) + : target_ (target) +{ +} + +template <class TARGET> ACE_INLINE void +ACE_PushSupplier_Adapter<TARGET>::disconnect_push_supplier (CORBA::Environment &_env) +{ + target_->_disconnect_push_supplier (_env); +} diff --git a/TAO/orbsvcs/Event_Service/Debug_Macros.h b/TAO/orbsvcs/Event_Service/Debug_Macros.h new file mode 100644 index 00000000000..8db3d169082 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Debug_Macros.h @@ -0,0 +1,11 @@ + +#if defined (ACE_ES_NOLOGGING) +#define ACE_ES_DEBUG(X) +#define ACE_ES_DEBUG_ST(X) +#else +#define ACE_ES_DEBUG(X) \ + do { \ + ACE_Log_Msg::instance ()->log X; \ + } while (0) +#define ACE_ES_DEBUG_ST(X) X +#endif /* ACE_ES_NOLOGGING */ diff --git a/TAO/orbsvcs/Event_Service/Dispatching_Modules.cpp b/TAO/orbsvcs/Event_Service/Dispatching_Modules.cpp new file mode 100644 index 00000000000..aacd16678a4 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Dispatching_Modules.cpp @@ -0,0 +1,606 @@ +// $Id$ + +#include "ace/Sched_Params.h" +#include "orbsvcs/Scheduler_Factory.h" +#include "Memory_Pools.h" + +#include "Dispatching_Modules.h" + +#if !defined (__ACE_INLINE__) +#include "Dispatching_Modules.i" +#endif /* __ACE_INLINE__ */ + +typedef ACE_EventChannel::DISPATCH_ERROR DISPATCH_ERROR; +typedef ACE_EventChannel::SYNCHRONIZATION_ERROR SYNC_ERROR; +typedef ACE_EventChannel::QOS_ERROR QOS_ERROR; + +// ************************************************************ + +void +ACE_ES_Dispatch_Request::make_copy (RtecEventComm::EventSet &dest) const +{ + if (use_single_event_) + { + dest.length (1); + dest[0] = single_event_; + } + else + { + dest.length (event_set_.length ()); + + for (CORBA::ULong index=0; index < event_set_.length (); index++) + { + RtecEventComm::Event &dest_event = dest[index]; + ACE_ES_Event_Container_var &source_event_var = ((ACE_ES_Event_Container_var &) event_set_[index]); + dest_event = *(source_event_var.operator->()); + } + } +} + +int +ACE_ES_Dispatch_Request::execute (u_long &command_action) +{ + ACE_TIMEPROBE (" dispatch (dequeue) the event"); + + return dispatching_module_->dispatch_event (this, command_action); +} + +#if 0 +void * +ACE_ES_Dispatch_Request::operator new (size_t nbytes) +{ + if (nbytes > sizeof (ACE_ES_Dispatch_Request)) + { + ACE_ERROR ((LM_ERROR, "nbytes = %d, sizeof (ACE_ES_Dispatch_Request_Chunk) = %d.\n", + sizeof (ACE_ES_Dispatch_Request))); + ACE_ASSERT (nbytes <= sizeof (ACE_ES_Dispatch_Request)); + } + + return ACE_ES_Memory_Pools::new_Dispatch_Request (); +} + +void +ACE_ES_Dispatch_Request::operator delete (void *mem) +{ + ACE_ES_Memory_Pools::delete_Dispatch_Request (mem); +} +#endif /* 0 */ + +// ************************************************************ + +ACE_ES_Priority_Dispatching::ACE_ES_Priority_Dispatching (ACE_EventChannel *channel, + int threads_per_queue) + : ACE_ES_Dispatching_Base (channel), + notification_strategy_ (this), + highest_priority_ (0), + shutdown_ (0), + threads_per_queue_ (threads_per_queue) +{ + // If we're single threaded, then we need to use the notification strategy. + if ((threads_per_queue_ == 0) && + (notification_strategy_.open () == -1)) + ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_ES_Priority_Dispatching")); + + // Initialize the queues. + for (int x=0; x < ACE_Scheduler_MAX_PRIORITIES; x++) + { + queues_[x] = 0; + delete_me_queues_[x] = 0; + } + + this->initialize_queues (); +} + +ACE_ES_Priority_Dispatching::~ACE_ES_Priority_Dispatching (void) +{ + // Delete the queues. + for (int x=0; x < ACE_Scheduler_MAX_PRIORITIES; x++) + delete delete_me_queues_[x]; +} + + +void +ACE_ES_Priority_Dispatching::initialize_queues (void) +{ + for (int x=0; x < ACE_Scheduler_MAX_PRIORITIES; x++) + { + RtecScheduler::Period tv = ACE_Scheduler_Rates[x]; + queues_[x] = new ACE_ES_Dispatch_Queue (this, ¬ification_strategy_); + if (queues_[x] == 0 || + queues_[x]->open_queue (tv, threads_per_queue_) == -1) + { + ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_ES_Priority_Dispatching::initialize_queues")); + return; + } + + queue_count_[x] = 1; + } + + highest_priority_ = ACE_Scheduler_MAX_PRIORITIES - 1; +} + +void +ACE_ES_Priority_Dispatching::connected (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &_env) +{ + down_->connected (consumer, _env); + + // This code does dynamic allocation of channel dispatch threads. + // It requires that consumer's priorities are known at connection + // time and that threads can request priorities from the scheduler + // at run-time. These are both antithetical to static scheduling. + // The constructor now allocates a thread per rate group. +#if 0 + // We have to tell the lower portions of the channel about the + // consumer first. This is so that any changes to the consumer's + // qos will take effect when we get the dispatch priority. + down_->connected (consumer, _env); + + RtecScheduler::OS_Priority priority = + ACE_Scheduler::instance ().preemption_priority (consumer->qos ().rt_info_); + + { + ACE_ES_GUARD ace_mon (lock_); + + // If a queue has not been created for the consumer's priority, + // create one. + if (queues_[priority] == 0) + { + // Allocate a new dispatch queue. + queues_[priority] = new ACE_ES_Dispatch_Queue (this, ¬ification_strategy_); + if (queues_[priority] == 0) + ACE_THROW (CORBA::NO_MEMORY (0, CORBA::COMPLETED_NO, + "ACE_ES_Priority_Dispatching::connected")); + + // Initialize the dispatch queue corresponding to the + // consumer's priority. With a full implementation of the + // run-time scheduler, the dispatch queue can find it's + // scheduling qos online. However, we pass the rate in case + // one is not found. The rate can be used to obtain the + // proper priority. If threads_per_queue_ == 0, then these + // queues will be passive. Otherwise, they will be active. + // This switches us between MT_ORB and ST_ORB. If we're + // single-threaded, this registers us with the ReactorEx using + // our notification_strategy_. If we're multi-threaded, this + // spawns the threads. + if (queues_[priority]->open_queue (priority, + threads_per_queue_) == -1) + ACE_THROW (DISPATCH_ERROR (0, CORBA::COMPLETED_NO, + "ACE_ES_Priority_Dispatching::connected:" + "queue open failed.\n")); + + // When this goes down to 0, we will shutdown the queue. + queue_count_[priority] = 1; + + // Keep track of this to optimize handle_signal. + if (priority > highest_priority_) + highest_priority_ = priority; + + ACE_DEBUG ((LM_DEBUG, "Created queue priority = %d.\n", priority)); + } + else + queue_count_[priority]++; + } +#endif +} + +void +ACE_ES_Priority_Dispatching::disconnected (ACE_Push_Consumer_Proxy *consumer) +{ + // We'll not dynamically close down queues. + ACE_UNUSED_ARG (consumer); + +#if 0 + RtecScheduler::OS_Priority priority = + ACE_Scheduler::instance ().preemption_priority (consumer->qos ().rt_info_); + + { + ACE_ES_GUARD ace_mon (lock_); + + // If there are no more users of this queue, then we *could* shut + // it down. However, we will not. + if (--queue_count_[priority] <= 0) + { + ACE_DEBUG ((LM_DEBUG, "(%t) unused dispatch queue priority = %d, " + "is_empty = %d.\n", + priority, queues_[priority]->msg_queue ()->is_empty ())); + + queues_[priority]->shutdown_task (); + } + } +#endif +} + +// @@ This method could have a bypass optimization. +// <request> has been dynamically allocated by the filtering module. +void +ACE_ES_Priority_Dispatching::push (ACE_ES_Dispatch_Request *request, + CORBA::Environment &_env) +{ + ACE_TIMEPROBE (" push_source_type: Correlation Module"); + + RtecScheduler::OS_Priority thread_priority; + RtecScheduler::Sub_Priority subpriority; + RtecScheduler::Preemption_Priority preemption_priority; + + if (request->rt_info () != 0) + { + // @@ TODO use ACE_TRY&friends + ACE_TIMEPROBE (" Priority_Dispatching::push - priority requested"); + ACE_Scheduler_Factory::server ()->priority + (request->rt_info (), + thread_priority, + subpriority, + preemption_priority, + _env); + ACE_TIMEPROBE (" Priority_Dispatching::push - priority obtained"); + if (_env.exception ()) + { + return; + } + } + else + { + thread_priority = + ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, + ACE_SCOPE_PROCESS); + subpriority = ACE_Scheduler_MIN_SUB_PRIORITY; + preemption_priority = ACE_Scheduler_MIN_PREEMPTION_PRIORITY; + } + + // If it's a request to forward an event, it needs a reference to us + // to call dispatch_event. + request->set (this, preemption_priority, subpriority); + + // Make sure that a queue exists for this priority. + if (queues_[preemption_priority] == 0) + { + ACE_ERROR ((LM_ERROR, "Push to closed queue %d, dropping event.\n", preemption_priority)); + return; +#if 0 + ACE_THROW (SYNC_ERROR (0, CORBA::COMPLETED_NO, "ACE_ES_Priority_Dispatching::push")); +#endif /* 0 */ + } + + // Enqueue the request. If we're multi-threaded, this request is a + // command object that will be called by the threads in the queue, + // or will be dequeued by this->handle_signal if we're + // single-threaded. + if (queues_[preemption_priority]->try_put (request) == -1) + { + if (ACE_ES_Dispatch_Request::release (request) != 0) + ACE_ERROR ((LM_ERROR, "ACE_ES_Priority_Dispatching::push" + " release failed.\n")); + if (errno != EPIPE) + { + ACE_THROW (CORBA::NO_MEMORY (CORBA::COMPLETED_NO)); + // @@ Orbix parameters + // 0, CORBA::COMPLETED_NO, + // "ACE_ES_Priority_Dispatching::push enqueue failed")); + } + else + { + ACE_DEBUG ((LM_DEBUG, + "Request rejected from closed queue %d.\n", + preemption_priority)); + } + } +} + +// Start at highest priority queue checking for queued events +// continuing to lowest priority queue. If an event is ever found, +// dispatch it and then start back at the highest priority queue +// again. +int +ACE_ES_Priority_Dispatching::handle_signal (int, siginfo_t *, ucontext_t *) +{ + int done; + + do + { + done = 1; + for (int x = 0; x <= highest_priority_; x++) + { + // If the queue is not empty, dispatch the request and then + // start the for loop from the beginning. + if ((queues_[x] != 0) && (!queues_[x]->msg_queue ()->is_empty ())) + { + // Dequeue and service the request. + queues_[x]->svc_one (); + + // Exit the for loop and start over. + done = 0; + break; + } + + // If we get through the whole for loop without dispatching + // anything, then we're done. + } + } + while (!done); + + + return 0; +} + +// This is only for the non-win32 single-threaded implementation. +int +ACE_ES_Priority_Dispatching::handle_input (ACE_HANDLE) +{ + return this->handle_signal (0, 0, 0); +} + +// Shutdown each queue. When each queue exits, they will call back +// this->dispatch_queue_closed which allows us to free up resources. +// When the last queue has closed, we'll delete ourselves. +void +ACE_ES_Priority_Dispatching::shutdown (void) +{ + if (shutdown_) + return; + + ACE_DEBUG ((LM_DEBUG, "(%t) ACE_ES_Priority_Dispatching " + "module shutting down.\n")); + + shutdown_ = 1; + + // If we're single threaded, then we need to shut down the + // notification strategy so it can remove itself from the reactor. + if (threads_per_queue_ == 0) + notification_strategy_.shutdown (); + + // Whether these are active or not, they must be shut down. + for (int x = 0; x <= highest_priority_; x++) + if (queues_[x] != 0) + { + ACE_DEBUG ((LM_DEBUG, "shutting down dispatch queue %d.\n", x)); + queues_[x]->shutdown_task (); + } +} + +// This gets called every time a Dispatch Queue closes down. We +// search for <queue> and delete it. If we have been told to delete +// ourself, after the last queue has been deleted, we delete +// ourselves. +void +ACE_ES_Priority_Dispatching::dispatch_queue_closed (ACE_ES_Dispatch_Queue *queue) +{ + ACE_ES_GUARD ace_mon (lock_); + + // Find the queue. + for (int x = 0; x <= highest_priority_; x++) + { + if (queues_[x] == queue) + { + ACE_DEBUG ((LM_DEBUG, "(%t) Dispatch queue %d is closed.\n", x)); + + // Store the queue for deleting in this object's destructor. + delete_me_queues_[x] = queues_[x]; + queues_[x] = 0; + + // Reset highest_priority_. + if (x == highest_priority_) + { + while ((--highest_priority_ >= 0) && + (queues_[highest_priority_] == 0)); + + if (highest_priority_ < 0) + { + ACE_DEBUG ((LM_DEBUG, "Dispatching module shut down.\n")); + up_->shutdown (); + return; + } + } + + // If we found the queue, we can exit the for loop. + break; + } + } +} + +/* +ACE_HANDLE +ACE_ES_Priority_Dispatching::get_handle (void) const +{ + ACE_ES_Priority_Dispatching *fake_this = (ACE_ES_Priority_Dispatching *) this; + return fake_this->notification_strategy_.get_handle (); +} +*/ + +// ************************************************************ + +ACE_ES_Dispatch_Queue::ACE_ES_Dispatch_Queue (ACE_ES_Dispatching_Base *dispatching_module, + ACE_ES_Notification_Strategy *notification_strategy) + : dispatching_module_ (dispatching_module), + notification_strategy_ (notification_strategy) +{ +} + +int +ACE_ES_Dispatch_Queue::open_queue (RtecScheduler::Period &period, + int threads) +{ + // First set up the correct message queue according to whether the + // dispatch queue will be active or not. + + // If there are no threads specified, we'll register with the + // reactor to be called back when someone queues a message. + if (threads == 0) + { + // Allocate a message queue that notifies a reactor when events + // arrive via the msg_queue call. If that succeeds, set the + // notification strategy in our message queue via the open call. + if (this->msg_queue () == 0 || + this->msg_queue ()->open (ACE_ES_QUEUE::DEFAULT_HWM, + ACE_ES_QUEUE::DEFAULT_LWM, + notification_strategy_) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p msg_queue.open failed.\n", + "ACE_ES_Dispatch_Queue::open_queue"), -1); + } + else + { + // Allocate a message queue that does not notify. + ACE_ES_MQ *mq = new ACE_ES_MQ; + if (mq == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Dispatch_Queue::open_queue"), -1); + else + { + // This deletes previous message queue. + this->msg_queue (mq); + // Set this so that the destructor of ACE_Task deletes our + // message queue. Note, this must be after the call to + // msg_queue. + delete_msg_queue_ = 1; + } + } + + // Create a name for ourselves using the priority. + char temp[64]; + ACE_OS::sprintf (temp, "ACE_ES_Dispatch_Queue-%u", period); + + // Open the task. This will query the scheduler for our qos + // structure. It will also synch_threads if it succeeds. + int result = this->open_task (temp); + + switch (result) + { + case -1: + // Error. + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Dispatch_Queue::open_queue"), -1); + case 0: + ACE_TRY + {// @@ TODO: Handle exceptions... + ACE_Scheduler_Factory::server()->set(rt_info_, + 0, 0, 0, 0, + RtecScheduler::VERY_LOW, + RtecScheduler::NO_QUANTUM, + 1, ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, + "ACE_ES_Display_Queue::exception"), -1); + } + ACE_ENDTRY; + case 1: + // Found. + break; + } + + // Spawn threads. + return this->synch_threads (threads); +} + +// This is called back by ACE_RT_Task when all the threads have +// exited. We're going to forward this event to the dispatching +// module so it can clean up any resources. +void +ACE_ES_Dispatch_Queue::threads_closed (void) +{ + dispatching_module_->dispatch_queue_closed (this); +} + +// ************************************************************ + +ACE_ES_EFD_Dispatching::ACE_ES_EFD_Dispatching (ACE_EventChannel *channel) + : ACE_ES_Dispatching_Base (channel) +{ +} + +void +ACE_ES_EFD_Dispatching::push (ACE_ES_Dispatch_Request *request, + CORBA::Environment &) +{ + // If it's a request to forward an event, it needs a reference to us + // to call dispatch_event. + request->set (this, 0, ACE_Scheduler_MIN_SUB_PRIORITY); + + u_long command_action = ACE_RT_Task_Command::RELEASE; + + // This may be a request to delete a push consumer proxy, so we + // should execute it instead of just forwarding it. + request->execute (command_action); + + switch (command_action) + { + case ACE_RT_Task_Command::RELEASE: + // Free the request. + if (ACE_ES_Dispatch_Request::release (request) != 0) + ACE_ERROR ((LM_ERROR, "ACE_ES_EFD_Dispatching::push" + " release failed.\n")); + break; + + default: + ACE_ERROR ((LM_ERROR, "ACE_ES_EFD_Dispatching::push: unknown command action.\n")); + } +} + +// ************************************************************ + +ACE_ES_RTU_Dispatching::ACE_ES_RTU_Dispatching (ACE_EventChannel *channel) + : ACE_ES_Priority_Dispatching (channel, 0) +{ +} + +// We're called from a dispatch queue, so we can not release the request. +int +ACE_ES_RTU_Dispatching::dispatch_event (ACE_ES_Dispatch_Request *request, + u_long &command_action) +{ + // Store the priority of the task currently running. + channel_->rtu_manager ()->priority (request->priority ()); + + ACE_TRY + { + // Forward the request. + up_->push (request, ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "ACE_ES_RTU_Dispatching::dispatch_event unknown exception.\n")); + } + ACE_ENDTRY; + + // Reset the priority. + channel_->rtu_manager ()->priority (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, ACE_SCOPE_PROCESS)); + + // If the task was preempted, enqueue the request on the head of the + // dispatch queue. + if (channel_->rtu_manager ()->not_done ()) + command_action = ACE_RT_Task_Command::UNGETQ; + else + // We're done with it. + command_action = ACE_RT_Task_Command::RELEASE; + + return 0; +} + +void +ACE_ES_RTU_Dispatching::push (ACE_ES_Dispatch_Request *request, + CORBA::Environment &_env) +{ + // First enqueue the message in the proper queue. + ACE_ES_Priority_Dispatching::push (request, _env); + + // If the current event is higher priority (lower value) than the + // current running task, then tell the task to preempt itself. + int request_priority = request->priority (); + int running_priority = channel_->rtu_manager ()->priority (); + if (request_priority < running_priority) + channel_->rtu_manager ()->should_preempt (1); + return; +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_CORBA_Sequence<ACE_CORBA_var<ACE_ES_Event_Container> >; +template void operator+=(ACE_CORBA_Sequence<ACE_CORBA_var<ACE_ES_Event_Container> > &, ACE_CORBA_var<ACE_ES_Event_Container> const &); + +#if defined(ACE_ES_LACKS_ORB) +template class ACE_CORBA_Sequence<ACE_ES_Event>; +#endif /* ACE_ES_LACKS_ORB */ + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/Event_Service/Dispatching_Modules.h b/TAO/orbsvcs/Event_Service/Dispatching_Modules.h new file mode 100644 index 00000000000..c82f3889ff7 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Dispatching_Modules.h @@ -0,0 +1,485 @@ +/* -*- C++ -*- */ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// orbsvcs +// +// = FILENAME +// Dispatching_Module +// +// = AUTHOR +// Tim Harrison (harrison@cs.wustl.edu) +// +// = DESCRIPTION +// This file holds the different Event Service dispatching +// mechanisms. These include null-dispatching (EFD), +// single-threaded with (RTU) and without preemption (LAME), and a +// multithreaded implementation. +// +// ============================================================================ + +#ifndef ACE_DISPATCHING_MODULES_H +#define ACE_DISPATCHING_MODULES_H + +#include "tao/Timeprobe.h" +#include "ReactorTask.h" +#include "Event_Channel.h" + +// ************************************************************ + +// Forward declarations. +class ACE_ES_Dispatch_Queue; +class ACE_ES_Dispatch_Request; + +// ************************************************************ + +// Forward declarations. +class ACE_ES_Consumer_Module; + +class ACE_ES_Dispatching_Base : public ACE_Event_Handler +// = TITLE +// Event Service Dispatch Module base class +// +// = DESCRIPTION +// We inherit from ACE_Event_Handler so that we can be called back +// by the ReactorEx when requests are queued. The virtual +// dispatch_event method allows ACE_ES_Dispatch_Requests to call +// back the dispatching module when acting as command objects. When +// this implementation is used by the Event Channel it forwards all +// dispatch calls without any queuing. Therefore, it can be +// used to build an EFD. It is also inherited by the Priority +// Dispatching module. +{ +public: + ACE_ES_Dispatching_Base (ACE_EventChannel *channel); + // Default construction. + + virtual void open (ACE_ES_Consumer_Module *up, + ACE_ES_Correlation_Module *down); + // Link to adjacent modules. + + virtual void connected (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &); + // Forward down_. + + virtual void disconnecting (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &); + // Forward down_. + + virtual void disconnected (ACE_Push_Consumer_Proxy *consumer); + // Release any unneeded dispatching resources. + + // = Not needed. + // void connected (ACE_Push_Supplier_Proxy *supplier); + // void disconnecting (ACE_Push_Supplier_Proxy *supplier); + + virtual void push (ACE_ES_Dispatch_Request *request, + CORBA::Environment &) = 0; + // Forward up_. + + virtual int dispatch_event (ACE_ES_Dispatch_Request *request, + u_long &command_action); + // Called by ACE_ES_Dispatch_Requests when dequeued by RT_Tasks. + + virtual void dispatch_queue_closed (ACE_ES_Dispatch_Queue *q); + // Called when all the threads of a <q> have exited. + + virtual void shutdown (void); + // This is called by the Event Channel. This will attempt to shut + // down all of its threads gracefully. Wish it luck. + +protected: + ACE_EventChannel *channel_; + // Dat der channel. + + ACE_ES_MUTEX lock_; + // To synchronize thr_count_. + + int thr_count_; + // The total number of threads in the Dispatching Module. This will + // be the sum of all the Dispatch Queue threads. + + ACE_ES_Consumer_Module *up_; + // Next module up. + + ACE_ES_Correlation_Module *down_; + // Next module down. +}; + +// ************************************************************ + +class ACE_ES_Dispatch_Request : public ACE_RT_Task_Command +// = TITLE +// ACE Event Service Dispatch Request +// +// = DESCRIPTION +// Encapsulates a consumer and the events that will be sent to the +// consumer. Right now, this class keeps a single_event_ that can +// be used when only one event is sent to the consumer. Since this +// is frequently the case (except for correlations), this +// optimization reduces the amount of dynamic memory allocation is +// necessary. This class is also a GOF Command object since it can +// be dequeued by an RT_Task to call back the dispatching module +// for request dispatching. +{ +public: + typedef ACE_CORBA_Sequence<ACE_ES_Event_Container_var> Event_Set; + + ACE_ES_Dispatch_Request (void); + // Default construction. + + virtual ~ACE_ES_Dispatch_Request (void); + // Default destruction. + + ACE_ES_Dispatch_Request (ACE_Push_Consumer_Proxy *consumer, + RtecScheduler::handle_t rt_info); + // All the events must be added after construction to the + // event_set. + + ACE_ES_Dispatch_Request (ACE_Push_Consumer_Proxy *consumer, + const Event_Set &event_set, + RtecScheduler::handle_t rt_info); + // Set consumer_ to <consumer> and copy <event_set> to event_set_. + // <rt_info> describes the method receiving this dispatch. + + ACE_ES_Dispatch_Request (ACE_Push_Consumer_Proxy *consumer, + const RtecEventComm::Time &time, + RtecScheduler::handle_t rt_info); + // Set consumer_ to <consumer> and sets single_event_.creation_time_ + // to <time>. Sets use_single_event_ to 1. <rt_info> describes the + // method receiving this dispatch. + + ACE_ES_Dispatch_Request (ACE_Push_Consumer_Proxy *consumer, + ACE_ES_Event_Container *event, + RtecScheduler::handle_t rt_info); + // Sets consumer_ and the first slot of event_set_. We use the + // event_set_ instead of the single_event_ so that we can just carry + // around the pointer to <event>. <rt_info> describes the method + // receiving this dispatch. + + RtecScheduler::handle_t rt_info (void); + // Description of the method receiving this request. + + void set (ACE_ES_Dispatching_Base *dispatching_module, + RtecScheduler::OS_Priority priority, + RtecScheduler::Sub_Priority sub_priority); + // For multi-threaded implementations, <dispatching_module> is + // called back when a request is dequeued. <priority> is the + // dispatch priority of the event. <sub_priority> is the enqueue + // priority of the event and will be forwarded to + // ACE_Message_Block. + + ACE_Push_Consumer_Proxy *consumer (void) const; + // Consumer accessor. + + const Event_Set &event_set (void) const; + // If accessed, make_copy will use event_set_. + + Event_Set &event_set (void); + // If accessed, make_copy will use event_set_. + + CORBA::ULong number_of_events (void) const; + // Returns 1 if we're using single_event, or event_set_.size (). + + void make_copy (RtecEventComm::EventSet &dest) const; + // Copy single_event or event_set into <dest>. + + virtual int execute (u_long &command_action); + // Calls dispatching_module_->dispatch_event. + + RtecScheduler::OS_Priority priority (void); + // Priority accessor. + +#if 0 + // @@ This cannot be done: the object would be allocated using this + // class operator new, but it will be removed using the + // ACE_Message_Block operator delete! + void *operator new (size_t nbytes); + // Allocates memory from a thread-specific memory pool. + + void operator delete (void *); + // Returns memory to a thread-specific memory pool. +#endif + +protected: + RtecScheduler::OS_Priority priority_; + + RtecScheduler::handle_t rt_info_; + // Describes the method receiving this dispatch. + + ACE_ES_Dispatching_Base *dispatching_module_; + // The dispatching module called back when we're dequeued by a + // thread. + + int use_single_event_; + // Is true if we're using a single event. Is 0 is we're using + // event_set_. + + ACE_Push_Consumer_Proxy *consumer_; + // The final destination for single_event_ or event_set_. + + ACE_ES_Event_Container single_event_; + // This is used for single event dispatches. + + Event_Set event_set_; + // This is used for event sets that need to be dispatched. +}; + +// ************************************************************ + +#if defined (ACE_WIN32) +class ACE_ES_ReactorEx_NS : public ACE_Notification_Strategy +// = TITLE +// Event Service ReactorEx Notification Strategy +// +// = DESCRIPTION +// Integrates the ACE_Message_Queue notification to signal a +// handle that will wake up the ACE_ES_Priority_Dispatching +// module. This is used in place of the +// ACE_ReactorEx_Notification_Strategy to avoid any queueing by +// the ReactorEx::notify mechanism. +{ +public: + ACE_ES_ReactorEx_NS (ACE_Event_Handler *eh); + // Stores away <eh> for when this->open is called. + + int open (void); + // Registers eh_ with the ReactorEx to be notified when this->notify + // is called. + + void shutdown (void); + // Removes self from the reactor. + + // = These result in eh_->handle_signal getting called. eh_ should + // point to a dispatching module. + virtual int notify (void); + virtual int notify (ACE_Event_Handler *, + ACE_Reactor_Mask mask); + + // ACE_HANDLE get_handle (void); + // Returns event_.handle (). + +private: + ACE_Auto_Event event_; + // Registered with the ReactorEx. +}; + +typedef ACE_ES_ReactorEx_NS ACE_ES_Notification_Strategy; + +#else // ******************************************************* + +class ACE_ES_Reactor_NS : public ACE_Reactor_Notification_Strategy +// = TITLE +// Event Service Reactor Notification Strategy +// +// = DESCRIPTION +// Maps to the ACE_Reactor_Notification_Strategy interface. This +// version is for non WIN32 platforms. +{ +public: + ACE_ES_Reactor_NS (ACE_Event_Handler *eh); + // Calls ACE_Reactor_Notification_Strategy with the ORB's reactor + // and signal mask. + + int open (void); + // Does nothing. + + void shutdown (void); + // Does nothing. +}; + +typedef ACE_ES_Reactor_NS ACE_ES_Notification_Strategy; + +#endif /* ACE_WIN32 */ + +// ************************************************************ + +class ACE_ES_MQ : public ACE_ES_QUEUE +// = TITLE +// Event Service Message Queue +{ + virtual int notify (void) { return 0;} + // Does nothing. +}; + +// ************************************************************ + +class ACE_ES_Dispatch_Queue : public ACE_RT_Task +// = TITLE +// Event Service Dispatch Queue +// +// = DESCRIPTION +// An encapsulation of a dispatch queue. By inheriting from +// ACE_RT_Task, we can make this zero-threaded or multi-threaded. +{ +public: + ACE_ES_Dispatch_Queue (ACE_ES_Dispatching_Base *dispatching_module, + ACE_ES_Notification_Strategy *notification_strategy); + // Stores <dispatching_module> for this->threads_closed. Stores + // away <notification_strategy> for this->synch_threads. + + int open_queue (RtecScheduler::Period &period, + int threads); + // This is a hack to get the channel to work with the new + // scheduler. + +#if 0 + int open_queue (RtecScheduler::OS_Priority priority, + int threads); + // Creates a name from the <priority> and tries to find a scheduling + // qos structure. If one is not found, but created, qos_ is set + // with default values. Either way, if qos_->thread_ > 0, it calls + // this->synch_threads. Otherwise, our message queue will use + // notification_strategy_. This will cause the ReactorEx to call + // back the dispatching_module_ when requests are queued on our + // message queue. Returns 0 on success, -1 on failure. +#endif + + virtual void threads_closed (void); + // Called when every thread has exited. This will call + // dispatching_module_->dispatch_queue_closed. + +private: + ACE_ES_Dispatching_Base *dispatching_module_; + // Used in threads_closed. + + ACE_ES_Notification_Strategy *notification_strategy_; + // Notifies the Dispatching Module when a request has been queued on + // our message queue. +}; + +// ************************************************************ + +class ACE_ES_Priority_Dispatching : public ACE_ES_Dispatching_Base +// = TITLE +// Event Service Priority Dispatching Module +// +// = DESCRIPTION +// Inherits from ACE_Event_Handler to utilitize the +// ACE_Message_Queue notification strategy. This implementation +// does priority dispatching without preemption. +{ +public: + ACE_ES_Priority_Dispatching (ACE_EventChannel *channel, + int threads_per_queue); + // Store <channel>. Spawns <threads_per_queue> thread for each + // dispatch queue. If != 0, then the channel is an MT_CHANNEL. If + // == 0, then the channel is an ST_CHANNEL. + + ~ACE_ES_Priority_Dispatching (void); + // Delete queues. + + void connected (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &); + // Allocate any needed dispatching resources for this consumers + // priority. + + void disconnected (ACE_Push_Consumer_Proxy *consumer); + // Release unneeded dispatch queues. + + // = Not needed. + // void connected (ACE_Push_Supplier_Proxy *supplier); + // void disconnecting (ACE_Push_Supplier_Proxy *supplier); + + virtual void push (ACE_ES_Dispatch_Request *request, + CORBA::Environment &); + // Enqueues the request on the appropriate Dispatch Queue. + + virtual void shutdown (void); + // Closes all queues "asynchronously." When all queues are closed, + // deletes them all and then deletes itself. + + virtual void dispatch_queue_closed (ACE_ES_Dispatch_Queue *q); + // Called when all the threads of a <q> have exited. Deletes <q>. + + // virtual ACE_HANDLE get_handle (void) const; + // Get the I/O handle. + +protected: + virtual int handle_signal (int signum, siginfo_t * = 0, ucontext_t * = 0); + // Called when input has arrived on a message queue. This is used + // for single-threaded implementations. + + virtual int handle_input (ACE_HANDLE); + // For single-threaded implementations on non-win32 platforms that + // use the ACE_Reactor_Notification_Strategy. This just forwards + // all calls to this->handle_signal (). + + ACE_ES_Notification_Strategy notification_strategy_; + // Shared between all dispatch queues. + + void initialize_queues (void); + // This is a hack to create a queue for each of the 4 rate groups. + + ACE_ES_Dispatch_Queue *queues_[ACE_Scheduler_MAX_PRIORITIES]; + // Pointers to dispatch queues. + + ACE_ES_Dispatch_Queue *delete_me_queues_[ACE_Scheduler_MAX_PRIORITIES]; + // Pointers to dispatch queues that want to die. + + int queue_count_[ACE_Scheduler_MAX_PRIORITIES]; + // The number of consumers using each queue. + + int highest_priority_; + // The highest priority queue in queues_. This allows us to + // optimize the handle_signal method. + + int shutdown_; + // Make sure to only shutdown the dispatching module once. + + int threads_per_queue_; + // The number of threads to spawn for each dispatch queue. +}; + +// ************************************************************ + +class ACE_ES_EFD_Dispatching : public ACE_ES_Dispatching_Base +// = TITLE +// Event Service EFD Dispatching Module +// +// = DESCRIPTION +// Implements a zero-threaded dispatcher with no preemption. +{ +public: + ACE_ES_EFD_Dispatching (ACE_EventChannel *channel); + // Acquires the proper qos structure and passes <channel> onto to + // the dispatching base constructor. + + virtual void push (ACE_ES_Dispatch_Request *request, + CORBA::Environment &); + // Forward up_. +}; + +// ************************************************************ + +class ACE_ES_RTU_Dispatching : public ACE_ES_Priority_Dispatching +// = TITLE +// Event Service RTU Dispatching Module +// +// = DESCRIPTION +// Implements a single-threaded dispatcher with delayed preemption. +{ +public: + ACE_ES_RTU_Dispatching (ACE_EventChannel *channel); + // Store <channel>. + + virtual int dispatch_event (ACE_ES_Dispatch_Request *request, + u_long &command_action); + // Called by ACE_Dispatch_Queues and handle_signal when an event + // needs to be dequeued. Implements an RTU-like delayed preemption + // policy. + + virtual void push (ACE_ES_Dispatch_Request *request, + CORBA::Environment &); + // Calls ACE_ES_Priority_Dispatching::push and then checks if + // preemption is necessary. +}; + +#if defined (__ACE_INLINE__) +#include "Dispatching_Modules.i" +#endif /* __ACE_INLINE__ */ +#endif /* ACE_DISPATCHING_MODULES_H */ + + diff --git a/TAO/orbsvcs/Event_Service/Dispatching_Modules.i b/TAO/orbsvcs/Event_Service/Dispatching_Modules.i new file mode 100644 index 00000000000..f9d7ea5dde4 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Dispatching_Modules.i @@ -0,0 +1,267 @@ +/* -*- C++ -*- */ +// $Id$ + +ACE_INLINE +ACE_ES_Dispatch_Request::ACE_ES_Dispatch_Request (void) : + priority_ (0), + rt_info_ (0), + dispatching_module_ (0), + use_single_event_ (0), + consumer_ (0), + single_event_ (), + event_set_ () +{ +} + +ACE_INLINE +ACE_ES_Dispatch_Request::~ACE_ES_Dispatch_Request (void) +{ +} + +ACE_INLINE +ACE_ES_Dispatch_Request::ACE_ES_Dispatch_Request (ACE_Push_Consumer_Proxy *consumer, + RtecScheduler::handle_t rt_info) : + priority_ (0), + rt_info_ (rt_info), + dispatching_module_ (0), + use_single_event_ (0), + consumer_ (consumer), + single_event_ (), + event_set_ () +{ +} + +ACE_INLINE +ACE_ES_Dispatch_Request::ACE_ES_Dispatch_Request (ACE_Push_Consumer_Proxy *consumer, + const Event_Set &event_set, + RtecScheduler::handle_t rt_info) : + priority_ (0), + rt_info_ (rt_info), + dispatching_module_ (0), + use_single_event_ (0), + consumer_ (consumer), + single_event_ (), + event_set_ (event_set) +{ +} + +ACE_INLINE +ACE_ES_Dispatch_Request::ACE_ES_Dispatch_Request (ACE_Push_Consumer_Proxy *consumer, + ACE_ES_Event_Container *event, + RtecScheduler::handle_t rt_info) : + priority_ (0), + rt_info_ (rt_info), + dispatching_module_ (0), + use_single_event_ (0), + consumer_ (consumer), + single_event_ (), + event_set_ () +{ + event_set_ += event; +} + +ACE_INLINE +ACE_ES_Dispatch_Request::ACE_ES_Dispatch_Request (ACE_Push_Consumer_Proxy *consumer, + const RtecEventComm::Time &time, + RtecScheduler::handle_t rt_info) : + priority_ (0), + rt_info_ (rt_info), + dispatching_module_ (0), + use_single_event_ (1), + consumer_ (consumer), + single_event_ (), + event_set_ () +{ + single_event_.creation_time_ = time; + single_event_.type_ = ACE_ES_EVENT_TIMEOUT; +} + +ACE_INLINE void +ACE_ES_Dispatch_Request::set (ACE_ES_Dispatching_Base *dispatching_module, + RtecScheduler::OS_Priority preemption_priority, + RtecScheduler::Sub_Priority sub_priority) +{ + dispatching_module_ = dispatching_module; + priority_ = preemption_priority; + ACE_Message_Block::msg_priority (sub_priority); +} + +ACE_INLINE ACE_Push_Consumer_Proxy * +ACE_ES_Dispatch_Request::consumer (void) const +{ + return consumer_; +} + +ACE_INLINE const ACE_ES_Dispatch_Request::Event_Set & +ACE_ES_Dispatch_Request::event_set (void) const +{ + return event_set_; +} + +ACE_INLINE ACE_ES_Dispatch_Request::Event_Set & +ACE_ES_Dispatch_Request::event_set (void) +{ + return event_set_; +} + +ACE_INLINE CORBA::ULong +ACE_ES_Dispatch_Request::number_of_events (void) const +{ + if (use_single_event_) + return 1; + else + return event_set_.length (); +} + +ACE_INLINE RtecScheduler::OS_Priority +ACE_ES_Dispatch_Request::priority (void) +{ + return priority_; +} + +ACE_INLINE RtecScheduler::handle_t +ACE_ES_Dispatch_Request::rt_info (void) +{ + return rt_info_; +} + +// ************************************************************ + +ACE_INLINE +ACE_ES_Dispatching_Base::ACE_ES_Dispatching_Base (ACE_EventChannel *channel) + : channel_ (channel), + thr_count_ (0), + up_ (0), + down_ (0) +{ +} + +ACE_INLINE void +ACE_ES_Dispatching_Base::open (ACE_ES_Consumer_Module *up, + ACE_ES_Correlation_Module *down) +{ + up_ = up; + down_ = down; + // 1 == 2. +} + +ACE_INLINE void +ACE_ES_Dispatching_Base::connected (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &_env) +{ + down_->connected (consumer, _env); +} + +ACE_INLINE void +ACE_ES_Dispatching_Base::disconnected (ACE_Push_Consumer_Proxy *consumer) +{ + // Do nothing. + ACE_UNUSED_ARG (consumer); +} + +ACE_INLINE void +ACE_ES_Dispatching_Base::disconnecting (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &_env) +{ + down_->disconnecting (consumer, _env); +} + +ACE_INLINE void +ACE_ES_Dispatching_Base::dispatch_queue_closed (ACE_ES_Dispatch_Queue *q) +{ + ACE_UNUSED_ARG (q); +} + +// Just forward the request. This is basically a hook for the RTU +// stuff. +ACE_INLINE int +ACE_ES_Dispatching_Base::dispatch_event (ACE_ES_Dispatch_Request *request, + u_long &command_action) +{ + ACE_TIMEPROBE (" decode the event"); + + ACE_TRY + { + // Forward the request. + up_->push (request, ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "ACE_ES_Dispatching_Base::dispatch_event unknown exception.\n")); + } + ACE_ENDTRY; + + // Tell our caller to release the request. + command_action = ACE_RT_Task_Command::RELEASE; + + // Return zero so our calling thread does not exit. + return 0; +} + +ACE_INLINE void +ACE_ES_Dispatching_Base::shutdown (void) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) ACE_ES_Dispatching_Base module shutting down.\n")); +} + +// ************************************************************ + +#if defined (ACE_WIN32) +ACE_INLINE +ACE_ES_ReactorEx_NS::ACE_ES_ReactorEx_NS (ACE_Event_Handler *eh) + : ACE_Notification_Strategy (eh, ACE_Event_Handler::NULL_MASK) +{ +} + +ACE_INLINE int +ACE_ES_ReactorEx_NS::open (void) +{ + return ACE_Task_Manager::instance ()-> + GetReactorTask (0)->get_reactor ().register_handler (eh_, event_.handle ()); +} + +ACE_INLINE void +ACE_ES_ReactorEx_NS::shutdown (void) +{ + ACE_Task_Manager::instance ()->GetReactorTask (0)-> + get_reactor ().remove_handler (eh_, ACE_Event_Handler::DONT_CALL); +} + +ACE_INLINE int +ACE_ES_ReactorEx_NS::notify (void) +{ + return event_.signal (); +} + +ACE_INLINE int +ACE_ES_ReactorEx_NS::notify (ACE_Event_Handler *eh, + ACE_Reactor_Mask mask) +{ + return event_.signal (); +} + +#else /* !defined (ACE_WIN32) */ +// This class is only necessary on non-win32 platforms. +ACE_INLINE +ACE_ES_Reactor_NS::ACE_ES_Reactor_NS (ACE_Event_Handler *eh) + : ACE_Reactor_Notification_Strategy (&(ACE_Task_Manager::instance ()-> + GetReactorTask (0)->get_reactor ()), + eh, ACE_Event_Handler::READ_MASK) +{ +} + +ACE_INLINE int +ACE_ES_Reactor_NS::open (void) +{ + return 0; +} + +ACE_INLINE void +ACE_ES_Reactor_NS::shutdown (void) +{ +} + +#endif /* ACE_WIN32 */ + +// ************************************************************ diff --git a/TAO/orbsvcs/Event_Service/Event_Channel.cpp b/TAO/orbsvcs/Event_Service/Event_Channel.cpp new file mode 100644 index 00000000000..3e41ecb9e9e --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Event_Channel.cpp @@ -0,0 +1,2830 @@ +// $Id$ + + +#include "ace/Service_Config.h" +#include "orbsvcs/Scheduler_Factory.h" + +#include "Dispatching_Modules.h" +#include "Memory_Pools.h" +#include "Event_Channel.h" + +// These are to save space. +#define WRITE_GUARD ACE_ES_WRITE_GUARD +#define READ_GUARD ACE_ES_READ_GUARD + +#if !defined (__ACE_INLINE__) +#include "Event_Channel.i" +#endif /* __ACE_INLINE__ */ + +// ************************************************************ + +static RtecScheduler::OS_Priority +Preemption_Priority (RtecScheduler::handle_t rtinfo) +{ + RtecScheduler::OS_Priority thread_priority; + RtecScheduler::Sub_Priority subpriority; + RtecScheduler::Preemption_Priority preemption_priority; + + ACE_TRY + { + ACE_TIMEPROBE (" Preemption_Priority - priority requested"); + ACE_Scheduler_Factory::server ()->priority + (rtinfo, + thread_priority, + subpriority, + preemption_priority, + ACE_TRY_ENV); + ACE_CHECK_ENV + ACE_TIMEPROBE (" connected - priority obtained"); + } + ACE_CATCH (RtecScheduler::UNKNOWN_TASK, ex_ut) + { + ACE_ERROR_RETURN ((LM_ERROR, "UNKNOWN_TASK %p.\n", + "Preemption_Priority"), 0); + } + ACE_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, "Unexpected exception %p.\n", + "Preemption_Priority"), 0); + + } + ACE_ENDTRY; + return preemption_priority; +} + +static RtecScheduler::OS_Priority +IntervalToPriority (RtecScheduler::Time interval) +{ + for (int x=0; x < ACE_Scheduler_MAX_PRIORITIES; x++) + if (interval <= ACE_Scheduler_Rates[x]) + return x; + + return ACE_Scheduler_MIN_PREEMPTION_PRIORITY; +} + +// ************************************************************ + +class Shutdown_Consumer : public ACE_ES_Dispatch_Request +// = TITLE +// Shutdown Consumer command +// +// = DESCRIPTION +// This command object is sent through the system when a consumer +// disconnects. When the Dispatching Module dequeues this request, +// it calls execute which execute calls back to the Consumer +// Module. At that point, the Consumer Module can tell the rest of +// the system that the consumer has disconnected and delete the +// consumer proxy. This allows all events queued for the consumer +// to be flushed to the consumer proxy (which will drop them). +// Events can be queued in the ReactorEx (in a dispatch set), or in +// the Dispatching Module. +{ +public: + // When executed, tells <consumer_module> that <consumer> has shut + // down. + Shutdown_Consumer (ACE_ES_Consumer_Module *consumer_module, + ACE_Push_Consumer_Proxy *consumer) + : consumer_module_ (consumer_module) + { + consumer_ = consumer; + + // Set rt_info_ to the lowest priority rt_info in consumer_. + // This is so the dispatching module can query us as a dispatch + // request to get the appropriate preemption priority. + ACE_ES_Dependency_Iterator iter (consumer->qos ().dependencies); + while (iter.advance_dependency () == 0) + { + RtecEventComm::EventType &type = (*iter).event_.type_; + if (type != ACE_ES_GLOBAL_DESIGNATOR && + type != ACE_ES_CONJUNCTION_DESIGNATOR && + type != ACE_ES_DISJUNCTION_DESIGNATOR) + { + if (rt_info_ == 0 || + ::Preemption_Priority ((*iter).rt_info) < + ::Preemption_Priority (rt_info_)) + rt_info_ = (*iter).rt_info; + } + } + } + + // Report to the consumer module that consumer_ has shutdown. + virtual int execute (u_long &command_action) + { + consumer_module_->shutdown_request (this); + command_action = ACE_RT_Task_Command::RELEASE; + return 0; + } + + void *operator new (size_t /* nbytes */) + { return ::new char[sizeof (Shutdown_Consumer)]; } + + void operator delete (void *buf) + { ::delete [] buf; } + + // The module that we report to. + ACE_ES_Consumer_Module *consumer_module_; +}; + +// ************************************************************ + +class Shutdown_Channel : public ACE_ES_Dispatch_Request +{ +public: + Shutdown_Channel (ACE_EventChannel *channel) : + channel_ (channel) {} + + // Report to the consumer module that consumer_ has shutdown. + virtual int execute (u_long &command_action) + { +#if 0 + channel_->destroy_i (); +#endif + command_action = ACE_RT_Task_Command::RELEASE; + return 0; + } + + void *operator new (size_t /* nbytes */) + { return ::new char[sizeof (Shutdown_Channel)]; } + + void operator delete (void *buf) + { ::delete [] buf; } + + ACE_EventChannel *channel_; +}; + +// ************************************************************ + +class ACE_ES_Priority_Timer : public ACE_Event_Handler +// = TITLE +// Event Service Timer +// +// = DESCRIPTION +// Manages a thread per priority, each of which sits on its own +// ReactorEx dispatching the timers for its given priority. +{ +public: + ACE_ES_Priority_Timer (void); + // Default construction. + + int connected (RtecScheduler::handle_t rt_info); + // This allows the Priority Timer to prespawn threads. Returns 0 on + // success, -1 on failure. + + int schedule_timer (RtecScheduler::handle_t rt_info, + const ACE_ES_Timer_ACT *act, + RtecScheduler::OS_Priority preemption_priority, + RtecScheduler::Time delta, + RtecScheduler::Time interval = 0); + // Schedule a timer at the appropriate priority for <preemption_priority>. + // Returns the preemption priority used on success, -1 on failure. + + int cancel_timer (RtecScheduler::OS_Priority preemption_priority, + int id, ACE_ES_Timer_ACT *&act); + // Cancel the timer associated with the priority of + // <preemption_priority> and <id>. <act> is filled in with the + // Timer_ACT used when scheduling the timer. Returns 0 on success, + // -1 on failure. + +private: + virtual int handle_timeout (const ACE_Time_Value &tv, + const void *act); + // Casts <act> to ACE_ES_Timer_ACT and calls execute. +}; + +// ************************************************************ + +class Flush_Queue_ACT : public ACE_ES_Timer_ACT +// = TITLE +// Flush Queue Asynchronous Completion Token +// +// = DESCRIPTION +// Carries a single dispatch request through the ReactorEx. +// Deletes itself when execute is called. +{ +public: + Flush_Queue_ACT (ACE_ES_Dispatch_Request *request, + ACE_ES_Dispatching_Module *dispatching_module) : + request_ (request), + dispatching_module_ (dispatching_module) { } + + virtual void execute (void) + { + ACE_TRY + { + ACE_ES_Dispatch_Request *request = request_; + dispatching_module_->push (request, ACE_TRY_ENV); + ACE_CHECK_ENV; + delete this; + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "(%t) Flush_Queue_ACT::execute: " + "Unknown exception..\n")); + } + ACE_ENDTRY; + } + + ACE_ES_Dispatch_Request *request_; + ACE_ES_Dispatching_Module *dispatching_module_; +}; + +// ************************************************************ + +// Since this class is *defined* in the cpp file, the INLINE +// definitions must also be in the cpp file. The should go here +// before any use of these methods. + +ACE_INLINE int +ACE_ES_Priority_Timer::schedule_timer (RtecScheduler::handle_t rt_info, + const ACE_ES_Timer_ACT *act, + RtecScheduler::OS_Priority preemption_priority, + RtecScheduler::Time delta, + RtecScheduler::Time interval) +{ + if (rt_info != 0) + { + // Add the timer to the task's dependency list. + RtecScheduler::handle_t timer_rtinfo = + ACE_Task_Manager::instance()->GetReactorTask (preemption_priority)->rt_info (); + + ACE_TRY + { + ACE_Scheduler_Factory::server()->add_dependency + (rt_info, timer_rtinfo, 1, ACE_TRY_ENV); + ACE_CHECK_ENV; + + ACE_DEBUG ((LM_ERROR, "ACE_ES_Priority_Timer::schedule_timer - " + "add_dependency (%d,%d,%d)\n", + rt_info, timer_rtinfo, 1)); + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "add dependency failed")); + } + ACE_ENDTRY; + } + + // @@ We're losing resolution here. + ACE_Time_Value tv_delta; + tv_delta.usec (int (delta / 10)); + if (tv_delta.usec () == 0) + tv_delta.usec (1); + + ACE_Time_Value tv_interval; + if (interval > 0) + { + tv_interval.usec (int (interval / 10)); + if (tv_interval.usec () == 0) + tv_interval.usec (1); + } + + return ACE_Task_Manager::instance()-> + GetReactorTask (preemption_priority)-> + get_reactor ().schedule_timer (this, + (void *) act, + tv_delta, tv_interval); +} + +ACE_INLINE int +ACE_ES_Priority_Timer::cancel_timer (RtecScheduler::OS_Priority preemption_priority, + int id, ACE_ES_Timer_ACT *&act) +{ + const void *vp; + + int result = ACE_Task_Manager::instance()-> + GetReactorTask (preemption_priority)-> + get_reactor ().cancel_timer (id, &vp); + + if (result == 0) + { + ACE_ERROR ((LM_ERROR, "ACE_ES_Priority_Timer::cancel_timer: " + "Tried to cancel nonexistent timer.\n")); + act = 0; + } + else + act = (ACE_ES_Timer_ACT *) vp; + + return result; +} + +// ************************************************************ + +ACE_ES_Event_Container::ACE_ES_Event_Container (void) : + // ACE_ES_Event (), + ref_count_ (1) +{ +} + +ACE_ES_Event_Container::~ACE_ES_Event_Container (void) +{ +} + +ACE_ES_Event_Container::ACE_ES_Event_Container (const ACE_ES_Event_Container &ec) + : RtecEventComm_Event (ec), + ref_count_ (1) +{ +} + +ACE_ES_Event_Container::ACE_ES_Event_Container (const RtecEventComm_Event &e) + : RtecEventComm_Event (e), + ref_count_ (1) +{ +} + +ACE_ES_Event_Container * +ACE_ES_Event_Container::_duplicate (void) +{ + ref_count_++; + return this; +} + +void +ACE_ES_Event_Container::_release (void) +{ + if (--ref_count_ == 0) + delete this; +} + +int +ACE_ES_Event_Container::operator== (const ACE_ES_Event_Container &event) +{ + RtecEventComm::Event &event1 = (RtecEventComm::Event &) *this; + RtecEventComm::Event &event2 = (RtecEventComm::Event &) event; + return event1 == event2; +} + +void * +ACE_ES_Event_Container::operator new (size_t nbytes) +{ + ACE_ASSERT (nbytes <= sizeof (ACE_ES_Event_Container)); + return ACE_ES_Memory_Pools::new_Event_Container (); +} + +void +ACE_ES_Event_Container::operator delete (void *mem) +{ + ACE_ES_Memory_Pools::delete_Event_Container (mem); +} + +void +ACE_ES_Event_Container::dump (void) +{ + ::dump_event ((RtecEventComm::Event &) *this); +} + +// ************************************************************ + +ACE_Push_Supplier_Proxy::ACE_Push_Supplier_Proxy (ACE_ES_Supplier_Module *sm) + : supplier_module_ (sm), + me_ (this), + push_supplier_ (0) +{ +} + +void +ACE_Push_Supplier_Proxy::connect_push_supplier (RtecEventComm::PushSupplier_ptr push_supplier, + const RtecEventChannelAdmin::SupplierQOS &qos, + CORBA::Environment &_env) +{ + if (this->connected ()) + ACE_THROW (RtecEventChannelAdmin::AlreadyConnected); + + push_supplier_ = + RtecEventComm::PushSupplier::_duplicate(push_supplier); + + // ACE_SupplierQOS_Factory::debug (qos); + + // Copy by value. + qos_ = qos; + + // ACE_SupplierQOS_Factory::debug (qos_); + + // @@ TODO: The SupplierQOS should have a more reasonable interface to + // obtain the supplier_id(), BTW, a callback to push_supplier will + // not work: it usually results in some form of dead-lock. + source_id_ = qos_.publications_[0].event_.source_; + + supplier_module_->connected (this, _env); +} + +void +ACE_Push_Supplier_Proxy::push (const RtecEventComm::EventSet &event, + CORBA::Environment &_env) +{ + ACE_TIMEPROBE (" enter Push_Supplier_Proxy::push"); + if (!this->connected ()) + ACE_THROW (RtecEventComm::Disconnected); + + // @@ TOTAL HACK + ACE_hrtime_t ec_recv = ACE_OS::gethrtime (); + for (CORBA::ULong i = 0; i < event.length (); ++i) + { + ACE_OS::memcpy (&event[i].ec_recv_time_, &ec_recv, + sizeof (RtecEventComm::Time)); + } + supplier_module_->push (this, event, _env); +} + +void +ACE_Push_Supplier_Proxy::disconnect_push_consumer (CORBA::Environment &_env) +{ + ACE_TIMEPROBE_PRINT; + if (this->connected ()) + { + push_supplier_ = 0; + supplier_module_->disconnecting (this, _env); + } +} + +void +ACE_Push_Supplier_Proxy::shutdown (void) +{ + ACE_TRY + { + push_supplier_->disconnect_push_supplier (ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "ACE_Push_Supplier_Proxy::shutdown failed.\n")); + } + ACE_ENDTRY; +} + +// ************************************************************ + +ACE_Push_Consumer_Proxy::ACE_Push_Consumer_Proxy (ACE_ES_Consumer_Module *cm) + : me_ (this), + push_consumer_ (0), + consumer_module_ (cm) +{ +} + +ACE_Push_Consumer_Proxy::~ACE_Push_Consumer_Proxy (void) +{ +} + + +void +ACE_Push_Consumer_Proxy::connect_push_consumer (RtecEventComm::PushConsumer_ptr push_consumer, + const RtecEventChannelAdmin::ConsumerQOS &qos, + CORBA::Environment &_env) +{ + if (this->connected ()) + ACE_THROW (RtecEventChannelAdmin::AlreadyConnected); + + push_consumer_ = + RtecEventComm::PushConsumer::_duplicate(push_consumer); + // @@ TODO Find out why are two duplicates needed... + RtecEventComm::PushConsumer::_duplicate(push_consumer); + + // ACE_ConsumerQOS_Factory::debug (qos); + + // Copy by value. + qos_ = qos; + + // ACE_ConsumerQOS_Factory::debug (qos_); + + consumer_module_->connected (this, _env); +} + +void +ACE_Push_Consumer_Proxy::disconnect_push_supplier (CORBA::Environment &_env) +{ + ACE_TIMEPROBE_PRINT; + consumer_module_->disconnecting (this, _env); + push_consumer_ = 0; +} + +void +ACE_Push_Consumer_Proxy::suspend (CORBA::Environment &) +{ + correlation_.suspend (); +} + +void +ACE_Push_Consumer_Proxy::resume (CORBA::Environment &) +{ + correlation_.resume (); +} + +void +ACE_Push_Consumer_Proxy::shutdown (void) +{ + ACE_TRY + { + push_consumer_->disconnect_push_consumer (ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "ACE_Push_Consumer_Proxy::shutdown failed.\n")); + } + ACE_ENDTRY; +} + +// ************************************************************ + +ACE_EventChannel::ACE_EventChannel (u_long type) + : POA_RtecEventChannelAdmin::EventChannel ("EventChannel"), + rtu_manager_ (0), + type_ (type), + state_ (INITIAL_STATE), + me_ (this), + destroyed_ (0) +{ + consumer_module_ = new ACE_ES_Consumer_Module (this); + // RtecEventChannelAdmin::ConsumerAdmin_duplicate(consumer_module_); + +#if defined(ACE_ES_LACKS_ORB) + UPSSingleProcessorOrb_startup(type, + dispatching_module, + rtu_active, + rtu_manager); +#else + ACE_NEW(dispatching_module_, + ACE_ES_Priority_Dispatching(this, THREADS_PER_DISPATCH_QUEUE)); +#endif + + correlation_module_ = new ACE_ES_Correlation_Module (this); + subscription_module_ = new ACE_ES_Subscription_Module (this); + supplier_module_ = new ACE_ES_Supplier_Module (this); + timer_ = new ACE_ES_Priority_Timer; + + consumer_module_->open (dispatching_module_); + dispatching_module_->open (consumer_module_, correlation_module_); + correlation_module_->open (dispatching_module_, subscription_module_); + subscription_module_->open (correlation_module_, supplier_module_); + supplier_module_->open (subscription_module_); +} + +ACE_EventChannel::~ACE_EventChannel (void) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) ACE_EventChannel deleting all modules.\n")); + + ACE_TRY + { + this->destroy (ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_EventChannel::~ACE_EventChannel")); + } + ACE_ENDTRY; + // @@ TODO: Shouldn't we use _release() instead? + delete rtu_manager_; + delete consumer_module_; + delete dispatching_module_; + delete correlation_module_; + delete subscription_module_; + delete supplier_module_; + delete timer_; +} + +void +ACE_EventChannel::destroy (CORBA::Environment &_env) +{ + ACE_UNUSED_ARG (_env); + + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_ERROR ((LM_ERROR, "ACE_EventChannel::destroy")); + + if (destroyed_ != 0) + return; + + destroyed_ = 1; + ACE_DEBUG ((LM_DEBUG, "(%t) Event Channel shutting down.\n")); + + // Send a shutdown message through the modules. + supplier_module_->shutdown (); + +#if 0 + // Flush all messages in the channel. + Shutdown_Channel *sc = new Shutdown_Channel (this); + if (sc == 0) + ACE_THROW (CORBA::NO_MEMORY (CORBA::COMPLETED_NO)); + // @@ TODO: Orbix parameters + // (0, CORBA::COMPLETED_NO, "ACE_EventChannel::destroy")); + + // Create a wrapper around the dispatch request. + Flush_Queue_ACT *act = new Flush_Queue_ACT (sc, dispatching_module_); + if (act == 0) + ACE_THROW (CORBA::NO_MEMORY (CORBA::COMPLETED_NO)); + // @@ TODO Orbix parameters + // (0, CORBA::COMPLETED_NO, "ACE_EventChannel::destroy")); + + // Set a 100ns timer. + if (this->timer ()->schedule_timer (0, // no rt-info + act, + ACE_Scheduler_MIN_PREEMPTION_PRIORITY, + 100, // 10 usec delta + 0) == -1) // no interval + { + ACE_ERROR ((LM_ERROR, "%p queue_request failed.\n", "ACE_ES_Consumer_Module")); + delete sc; + delete act; + } +#endif +} + +void +ACE_EventChannel::shutdown (void) +{ + // @@ TODO: Find a portable way to shutdown the ORB, on Orbix we have + // to call deactive_impl () on a CORBA::POA is that the portable + // way? + // With TAO we need access to the ORB (to call shutdown() on it). + TAO_ORB_Core_instance ()->orb ()->shutdown (); +} + +void +ACE_EventChannel::report_connect (u_long event) +{ + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_ERROR ((LM_ERROR, "ACE_EventChannel::report_connect")); + + ACE_CLR_BITS (state_, event); +} + +void +ACE_EventChannel::report_disconnect (u_long event) +{ + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_ERROR ((LM_ERROR, "ACE_EventChannel::report_disconnect")); + + ACE_SET_BITS (state_, event); + if (state_ == SHUTDOWN) + ACE_DEBUG ((LM_DEBUG, "(%t) Event Channel has no consumers or suppliers.\n")); +} + +// ************************************************************ + +ACE_ES_Subscription_Info::~ACE_ES_Subscription_Info (void) +{ + Subscriber_Map_Iterator iter (type_subscribers_); + + // Delete all type collections. + for (Subscriber_Map_Entry *temp = 0; + iter.next (temp) != 0; + iter.advance ()) + { + delete temp->int_id_; + } +} + +/* +void +ACE_ES_Subscription_Info::Type_Subscribers::operator= +(const ACE_ES_Subscription_Info::Type_Subscribers &rhs) +{ + ACE_ES_Subscription_Info::Subscriber_Set_Iterator iter (rhs.subscribers_); + + for (ACE_ES_Consumer_Rep **consumer = 0; + iter.next (consumer) != 0; + iter.advance ()) + { + if (subscribers_.insert (consumer) != 0) + ACE_ERROR ((LM_ERROR, "%p insert failed.\n", + "ACE_ES_Subscription_Info::Type_Subscribers::operator=")); + } + + // Pointer copy. + dependency_info_ = rhs.dependency_info_; +} +*/ + +// Remove <consumer> from the consumer set in <type_map> set +// corresponding to <type>. +int +ACE_ES_Subscription_Info::remove (Subscriber_Map &type_map, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type) +{ + Type_Subscribers *subscribers; + + // Find the type set within the type collection. + if (type_map.find (type, subscribers) == -1) + // type_map does not contain the type. + return -1; + + // Remove the consumer from the type set. + if (subscribers->consumers_.remove (consumer) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p remove failed.\n", + "ACE_ES_Subscriber_Info::remove"), -1); + // @@ Should probably remove the supplier from the consumers caller + // list. + + // If the set is empty, remove it from the type collection. + if (subscribers->consumers_.size () == 0) + { + Type_Subscribers *removed_subscribers; + if (type_map.unbind (type, removed_subscribers) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p unbind failed.\n", + "ACE_ES_Subscriber_Info::remove"), -1); + + // Sanity check. + if (removed_subscribers != subscribers) + ACE_ERROR_RETURN ((LM_ERROR, "ACE_ES_Subscriber_Info::remove: " + "removed wrong set!\n"), -1); + + // Free up the set removed. + delete removed_subscribers; + } + + return 0; +} + + +int +ACE_ES_Subscription_Info::remove (SourceID_Map &source_subscribers, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID sid) +{ + Subscriber_Set *subscribers; + + // Find the subscribers of <sid>. + if (source_subscribers.find (sid, subscribers) == -1) + // does not contain the <sid>. + return -1; + + // Remove the consumer from the subscriber set. + if (subscribers->remove (consumer) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p remove failed.\n", + "ACE_ES_Subscriber_Info::remove"), -1); + // @@ Should probably remove the supplier from the consumers caller + // list. + + // If the set is empty, remove it from the type collection. + if (subscribers->size () == 0) + { + Subscriber_Set *removed_subscribers; + if (source_subscribers.unbind (sid, removed_subscribers) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p unbind failed.\n", + "ACE_ES_Subscriber_Info::remove"), -1); + + // Sanity check. + if (removed_subscribers != subscribers) + ACE_ERROR_RETURN ((LM_ERROR, "ACE_ES_Subscriber_Info::remove: " + "removed wrong set!\n"), -1); + + // Free up the set removed. + delete removed_subscribers; + } + + return 0; +} + + +void +ACE_ES_Subscription_Info::append_subscribers (Subscriber_Set &dest, + Subscriber_Set &src) +{ + Subscriber_Set_Iterator src_iter (src); + + // Iterate through the source set. Add each source proxy to the + // destination set. + for (ACE_ES_Consumer_Rep **proxy = 0; + src_iter.next (proxy) != 0; + src_iter.advance ()) + { + if (dest.insert (*proxy) == -1) + ACE_ERROR ((LM_ERROR, "%p: insert failed.\n", "append_subscribers")); + } +} + +int +ACE_ES_Subscription_Info::insert_or_allocate (SourceID_Map &sid_map, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID sid) +{ + Subscriber_Set *subscribers; + + if (sid_map.find (sid, subscribers) == -1) + { + // If the correct type set does not exist, make one with a null + // dependency info (since there is no supplier of this event). + subscribers = new Subscriber_Set; + + if (sid_map.bind (sid, subscribers) == -1) + { + ACE_ERROR ((LM_ERROR, "%p bind failed.\n", + "ACE_ES_Subscription_Info::insert_or_allocate")); + delete subscribers; + return -1; + } + } + + // 0 and 1 are success for insert. + return subscribers->insert (consumer) == -1 ? -1 : 0; +} + +int +ACE_ES_Subscription_Info::insert_or_allocate (Subscriber_Map &type_map, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type) +{ + Type_Subscribers *subscribers; + + if (type_map.find (type, subscribers) == -1) + { + // If the correct type set does not exist, make one with a null + // dependency info (since there is no supplier of this event). + subscribers = new Type_Subscribers (0); + + if (type_map.bind (type, subscribers) == -1) + { + ACE_ERROR ((LM_ERROR, "%p bind failed.\n", + "ACE_ES_Subscription_Info::insert_or_allocate")); + delete subscribers; + return -1; + } + } + + return subscribers->consumers_.insert (consumer); +} + +int +ACE_ES_Subscription_Info::insert_or_fail (Subscriber_Map &type_map, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type, + RtecScheduler::Dependency_Info *&dependency) +{ + Type_Subscribers *subscribers; + + // Get the subscriber set for <type>. + if (type_map.find (type, subscribers) == -1) + return -1; + + // Pass back the description of the method generating <type>. + dependency = subscribers->dependency_info_; + + // Insert the new consumer into the subscriber set. + return subscribers->consumers_.insert (consumer); +} + +// ************************************************************ + +typedef ACE_EventChannel::SYNCHRONIZATION_ERROR SYNC_ERROR; +typedef ACE_EventChannel::QOS_ERROR QOS_ERROR; +typedef ACE_EventChannel::SUBSCRIPTION_ERROR SUBSCRIPTION_ERROR; +typedef ACE_EventChannel::CORRELATION_ERROR CORRELATION_ERROR; + +// ************************************************************ + +ACE_ES_Consumer_Module::ACE_ES_Consumer_Module (ACE_EventChannel* channel) + : lock_ (), + all_consumers_ (), + channel_ (channel), + me_ (this), + down_ (0) +{ +} + +void +ACE_ES_Consumer_Module::open (ACE_ES_Dispatching_Module *down) +{ + down_ = down; +} + +void +ACE_ES_Consumer_Module::connected (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &_env) +{ + channel_->report_connect (ACE_EventChannel::CONSUMER); + down_->connected (consumer, _env); +} + +void +ACE_ES_Consumer_Module::shutdown_request (ACE_ES_Dispatch_Request *request) +{ + Shutdown_Consumer *sc = (Shutdown_Consumer *) request; + + // Tell everyone else that the consumer is disconnected. This means + // that *nothing* is left in the system for the consumer, so + // everyone can free up any resources. + down_->disconnected (sc->consumer ()); + + ACE_DEBUG ((LM_DEBUG, "Deleting proxy for consumer\n")); + + // Delete the consumer proxy. + delete sc->consumer (); + + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + return; + + // Tell the channel that we may need to shut down. + if (all_consumers_.size () <= 0) + { + ACE_DEBUG ((LM_DEBUG, "(%t) No more consumers connected.\n")); + channel_->report_disconnect (ACE_EventChannel::CONSUMER); + } +} + +void +ACE_ES_Consumer_Module::shutdown (void) +{ + Consumers copy; + + { + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + goto DONE; + + if (all_consumers_.size () == 0) + goto DONE; + + // Make a copy so that the consumers can disconnect without the + // lock being held. + copy = all_consumers_; + } + + // This scope is just to thwart the compiler. It was complaining + // about the above goto's bypassing variable initializations. Yadda + // yadda. + { + Consumer_Iterator iter (copy); + + CORBA::Environment env; + + for (ACE_Push_Consumer_Proxy **proxy = 0; + iter.next (proxy) != 0; + iter.advance ()) + { + (*proxy)->shutdown (); + CORBA::release (*proxy); + // Shouldn't this be _release () + + // Remove the consumer from our list. + { + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_ERROR ((LM_ERROR, "%p Failed to acquire lock.\n", "ACE_ES_Consumer_Module::shutdown")); + + if (all_consumers_.remove (*proxy) == -1) + ACE_ERROR ((LM_ERROR, "%p Failed to remove consumer.\n", "ACE_ES_Consumer_Module::shutdown")); + } + } + } + +DONE: + channel_->shutdown (); +} + +void +ACE_ES_Consumer_Module::disconnecting (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &_env) +{ + { + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_THROW (SYNC_ERROR); + // @@ TODO Orbix parameters + // (0, CORBA::COMPLETED_NO, "ACE_ES_Consumer_Module::disconnected")); + + if (all_consumers_.remove (consumer) == -1) + return; + } + + // Tell everyone else that the consumer is disconnecting. This + // allows them to remove the consumer from any subscription lists + // etc. However, messages may still be queued in the ReactorEx or + // in the Dispatching Module for this consumer, so no queues or + // proxies can be deleted just yet. + down_->disconnecting (consumer, _env); + + // Send a shutdown message through the system. When this is + // dispatched, the consumer proxy will be deleted. <request> is + // queued in the Priority_Timer at <priority> level. It will be + // scheduled for dispatching in 1 nanosecond. This gives components + // a hook into the first queueing point in the channel. + + // Create a shutdown message. When this is dispatched, it will + // delete the proxy. + Shutdown_Consumer *sc = new Shutdown_Consumer (this, consumer); + if (sc == 0) + ACE_THROW (CORBA::NO_MEMORY (CORBA::COMPLETED_NO)); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, "ACE_ES_Consumer_Module::disconnected")); + + // Create a wrapper around the dispatch request. + Flush_Queue_ACT *act = new Flush_Queue_ACT (sc, channel_->dispatching_module_); + if (act == 0) + ACE_THROW (CORBA::NO_MEMORY (CORBA::COMPLETED_NO)); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, "ACE_ES_Consumer_Module::disconnecting")); + + ACE_DEBUG ((LM_DEBUG, "(%t) initiating consumer disconnect.\n")); + + // Set a 100ns timer. + if (channel_->timer ()->schedule_timer (0, // no rt_info + act, + // ::Preemption_Priority (consumer->qos ().rt_info_), + ACE_Scheduler_MIN_PREEMPTION_PRIORITY, + 100, 0) == -1) + { + ACE_ERROR ((LM_ERROR, "%p queue_request failed.\n", "ACE_ES_Consumer_Module")); + delete sc; + delete act; + } +} + +// This method executes in the same thread of control that will hand +// the event set to the consumer (or it's proxy). A network proxy may +// copy the event set to the network buffer. An active client may +// copy the event set to be queued. Or a same address-space consumer +// can read the set we allocated off the stack. +void +ACE_ES_Consumer_Module::push (const ACE_ES_Dispatch_Request *request, + CORBA::Environment &_env) +{ + ACE_TIMEPROBE (" enter ES_Consumer_Module::push"); + // We'll create a temporary event set with the size of the incoming + // request. + RtecEventComm::EventSet event_set (request->number_of_events ()); + request->make_copy (event_set); + + // Forward the event set. + // @@ TOTAL HACK + ACE_hrtime_t ec_send = ACE_OS::gethrtime (); + for (CORBA::ULong i = 0; i < event_set.length (); ++i) + { + ACE_OS::memcpy (&event_set[i].ec_send_time_, &ec_send, + sizeof (RtecEventComm::Time)); + } + request->consumer ()->push (event_set, _env); + ACE_TIMEPROBE (" leave ES_Consumer_Module::push"); +} + +RtecEventChannelAdmin::ProxyPushSupplier_ptr +ACE_ES_Consumer_Module::obtain_push_supplier (CORBA::Environment &_env) +{ + ACE_Push_Consumer_Proxy *new_consumer = new ACE_Push_Consumer_Proxy (this); + + // Get a new supplier proxy object. + if (new_consumer == 0) + { + ACE_ERROR ((LM_ERROR, "ACE_EventChannel" + "::obtain_push_supplier failed.\n")); + ACE_THROW_RETURN (CORBA::NO_MEMORY (CORBA::COMPLETED_NO), 0); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, "ACE_ES_Consumer_Module::obtain_push_supplier")); + } + + { + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + { + delete new_consumer; + ACE_THROW_RETURN (SYNC_ERROR, 0); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, + // "ACE_ES_Consumer_Module::obtain_push_supplier"), 0); + } + + if (all_consumers_.insert (new_consumer) == -1) + ACE_ERROR ((LM_ERROR, "ACE_ES_Consumer_Module insert failed.\n")); + } + + // Return the CORBA object reference to the new supplier proxy. + return new_consumer->get_ref (); +} + +// ************************************************************ + +ACE_ES_Correlation_Module::ACE_ES_Correlation_Module (ACE_EventChannel *channel) + : channel_ (channel), + up_ (0), + subscription_module_ (0) +{ +} + +void +ACE_ES_Correlation_Module::open (ACE_ES_Dispatching_Module *up, + ACE_ES_Subscription_Module *sm) +{ + up_ = up; + subscription_module_ = sm; +} + +void +ACE_ES_Correlation_Module::connected (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &_env) +{ + // Initialize the consumer correlation filter. + if (consumer->correlation ().connected (consumer, this) == -1) + ACE_THROW (CORRELATION_ERROR); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, "ACE_ES_Correlation_Module::connected")); +} + +void +ACE_ES_Correlation_Module::disconnecting (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &) +{ + if (consumer->correlation ().disconnecting () == -1) + ACE_ERROR ((LM_ERROR, "ACE_ES_Correlation_Module::disconnecting failed.\n")); +} + +int +ACE_ES_Correlation_Module::subscribe (ACE_ES_Consumer_Rep *consumer) +{ + return subscription_module_->subscribe (consumer); +} + +/* +int +ACE_ES_Correlation_Module::unsubscribe (ACE_ES_Consumer_Rep *cr) +{ + return subscription_module_->unsubscribe (cr); +} +*/ + +void +ACE_ES_Correlation_Module::push (ACE_ES_Consumer_Rep *consumer, + ACE_ES_Event_Container *event, + CORBA::Environment &_env) +{ + ACE_TIMEPROBE (" enter ACE_ES_Correlation_Module::push"); + ACE_ES_Dispatch_Request *request = + consumer->correlation ()->push (consumer, event); + ACE_TIMEPROBE (" pushed to Correlation_Module"); + + // If request == 0, then the event was queued for later. Otherwise, + // we need to push the event now. + if (request != 0) + up_->push (request, _env); + + ACE_TIMEPROBE (" push_source_type: Dispatch Module enqueuing"); +} + +// Must check consumer->qos ().use_timeout () before calling this. +// This method is supposed properly schedule a timer with respect to +// the consumer's priority AND the correlation that should receive the +// timeout event. +int +ACE_ES_Correlation_Module::schedule_timeout (ACE_ES_Consumer_Rep_Timeout *consumer) +{ + RtecEventComm::Time &interval = consumer->dependency ()->event_.creation_time_; + RtecEventComm::Time &delay = consumer->dependency ()->event_.creation_time_; + + // Store the preemption priority so we can cancel the correct timer. + // The priority values may change during the process lifetime (e.g., + // after the scheduler has been run). + consumer->preemption_priority (::IntervalToPriority (interval)); + + // Register the timer. + int id = channel_->timer ()->schedule_timer (consumer->dependency ()->rt_info, + consumer, + consumer->preemption_priority (), + delay, interval); + + // Store the timer id for canceling. + consumer->timer_id (id); + + if (id == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p schedule timer failed.\n", + "ACE_ES_Correlation_Module::schedule_timeout"), -1); + + return 0; +} + +// Must check consumer->qos ().timeout_ before calling this. +int +ACE_ES_Correlation_Module::cancel_timeout (ACE_ES_Consumer_Rep_Timeout *consumer) +{ + // Cancel the timer from the Priority Timer. + ACE_ES_Timer_ACT *act; + channel_->timer ()->cancel_timer (consumer->preemption_priority (), + consumer->timer_id (), + act); + + ACE_ASSERT (consumer == act); + + // Free up the Timer ACT. + // delete act; + + return 0; +} + + +int +ACE_ES_Correlation_Module::reschedule_timeout (ACE_ES_Consumer_Rep_Timeout *consumer) +{ + if (this->cancel_timeout (consumer) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", "ACE_ES_Disjunction_Group::reschedule_deadline"), -1); + else + { + RtecEventComm::Time &interval = consumer->dependency ()->event_.creation_time_; + RtecEventComm::Time &delay = consumer->dependency ()->event_.creation_time_; + + // Store the preemption priority so we can cancel the correct timer. + // The priority values may change during the process lifetime (e.g., + // after the scheduler has been run). + consumer->preemption_priority (::IntervalToPriority (interval)); + + // Register the timer. + int id = channel_->timer ()->schedule_timer (0, // Do not pass an RT_Info. + consumer, + consumer->preemption_priority (), + delay, interval); + + // Store the timer id for canceling. + consumer->timer_id (id); + + if (id == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p schedule timer failed.\n", + "ACE_ES_Correlation_Module::reschedule_timeout"), -1); + + return 0; + } +} + +void +ACE_ES_Correlation_Module::shutdown (void) +{ + // Perhaps this should call disconnecting on all the consumers? + // We'll opt to just forward this message for now. + up_->shutdown (); +} + +// ************************************************************ + +ACE_ES_Consumer_Correlation::ACE_ES_Consumer_Correlation (void) : + correlation_module_ (0), + type_id_index_ (0), + channel_ (0), + qos_ (), + pending_events_ (0), + lock_ (), + consumer_ (0), + pending_flags_ (0), + consumer_reps_ (0), + n_consumer_reps_ (0), + timer_reps_ (0), + n_timer_reps_ (0), + conjunction_groups_ (0), + n_conjunction_groups_ (0), + disjunction_groups_ (0), + n_disjunction_groups_ (0), + connected_ (0) +{ +} + +ACE_ES_Consumer_Correlation::~ACE_ES_Consumer_Correlation (void) +{ + delete [] timer_reps_; + for (int cr = 0; cr < n_consumer_reps_; cr++) + consumer_reps_[cr]->_release (); + delete [] consumer_reps_; + delete [] conjunction_groups_; + delete [] disjunction_groups_; + delete [] pending_events_; +} + +void +ACE_ES_Consumer_Correlation::disconnect_push_supplier (CORBA::Environment &) +{ + connected_ = 0; +} + +int +ACE_ES_Consumer_Correlation::allocate_correlation_resources (ACE_ES_Dependency_Iterator &iter) +{ + n_conjunction_groups_ = iter.n_conjunctions (); + if (n_conjunction_groups_ > 0) + { + conjunction_groups_ = new ACE_ES_Conjunction_Group[n_conjunction_groups_]; + if (conjunction_groups_ == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", "ACE_ES_Consumer_Correlation::connected"), -1); + for (int n=0; n < n_conjunction_groups_; n++) + conjunction_groups_[n].set_correlation_module (correlation_module_); + } + + n_disjunction_groups_ = iter.n_disjunctions (); + if (n_disjunction_groups_ > 0) + { + disjunction_groups_ = new ACE_ES_Disjunction_Group[n_disjunction_groups_]; + if (disjunction_groups_ == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", "ACE_ES_Consumer_Correlation::connected"), -1); + for (int n=0; n < n_disjunction_groups_; n++) + disjunction_groups_[n].set_correlation_module (correlation_module_); + } + + n_consumer_reps_ = iter.n_events (); + if (n_consumer_reps_ > 0) + { + // This allocates more than is needed if there are repeats: + // (A+B)|(B+C). We allocate these individually so that they can + // be deleted individually. + + typedef ACE_ES_Consumer_Rep *reparray; + consumer_reps_ = new reparray[n_consumer_reps_]; + + for (int cr = 0; cr < n_consumer_reps_; cr++) + { + consumer_reps_[cr] = new ACE_ES_Consumer_Rep; + if (consumer_reps_[cr] == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", "ACE_ES_Consumer_Correlation::connected"), -1); + } + } + + n_timer_reps_ = iter.n_timeouts (); + if (n_timer_reps_ > 0) + { + timer_reps_ = new ACE_ES_Consumer_Rep_Timeout[n_timer_reps_]; + if (timer_reps_ == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", "ACE_ES_Consumer_Correlation::connected"), -1); + } + + // This allocates more than is needed. + pending_events_ = new Event_Set[n_consumer_reps_ + n_timer_reps_]; + if (pending_events_ == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", "ACE_ES_Consumer_Correlation::connected"), -1); + + return 0; +} + +// We don't need synchronization until after we've been connected and +// subscribed to events. +int +ACE_ES_Consumer_Correlation::connected (ACE_Push_Consumer_Proxy *consumer, + ACE_ES_Correlation_Module *correlation_module) +{ + correlation_module_ = correlation_module; + consumer_ = consumer; + + // for (CORBA_Types::ULong index=0; index < consumer->qos ().dependencies_.length (); index++) + // consumer->qos ().dependencies_[index].event_.dump (); + + ACE_ES_Dependency_Iterator iter (consumer->qos ().dependencies); + iter.parse (); + if (this->allocate_correlation_resources (iter) == -1) + return -1; + + + int cgroup_index = -1; + int dgroup_index = -1; + int crep_index = 0; + int trep_index = 0; + RtecEventComm::EventType group_type = 0; + + while (iter.advance_dependency () == 0) + { + // Keep track of how many conjunction and disjunction groups are + // registered. Update the index pointers so that the helper + // functions can update the appropriate group objects. + switch ((*iter).event_.type_) + { + case ACE_ES_CONJUNCTION_DESIGNATOR: + cgroup_index++; + ACE_ASSERT (cgroup_index < n_conjunction_groups_); + group_type = ACE_ES_CONJUNCTION_DESIGNATOR; + continue; + + case ACE_ES_DISJUNCTION_DESIGNATOR: + dgroup_index++; + ACE_ASSERT (dgroup_index < n_disjunction_groups_); + group_type = ACE_ES_DISJUNCTION_DESIGNATOR; + continue; + + case ACE_ES_GLOBAL_DESIGNATOR: + group_type = ACE_ES_GLOBAL_DESIGNATOR; + continue; + + // These Delegate to the appropriate registration method. +#if 0 + // @@ TODO rt_info_ is a handle_t now, does checking against + // 0 still make sense? + // Check for a null rt_info. + if ((*iter).rt_info_ == 0) + { + ACE_ERROR ((LM_ERROR, "Found a ConsumerQOS::dependencies[].rt_info_ == 0.\n")); + continue; + } +#endif /* 0 */ + + case ACE_ES_EVENT_TIMEOUT: + // For backwards compatibility. + case ACE_ES_EVENT_DEADLINE_TIMEOUT: + if (this->register_deadline_timeout (*iter, + group_type, + cgroup_index, + dgroup_index, + trep_index) == -1) + return -1; + break; + + case ACE_ES_EVENT_INTERVAL_TIMEOUT: + if (this->register_interval_timeout (*iter, + group_type, + cgroup_index, + dgroup_index, + trep_index) == -1) + return -1; + break; + + case ACE_ES_EVENT_ACT: + // Store the ACT in the current conjunction or disjunction + // group. + switch (group_type) + { + case ACE_ES_CONJUNCTION_DESIGNATOR: + conjunction_groups_[cgroup_index].set_act ((*iter).event_); + break; + case ACE_ES_DISJUNCTION_DESIGNATOR: + disjunction_groups_[cgroup_index].set_act ((*iter).event_); + break; + case ACE_ES_GLOBAL_DESIGNATOR: + default: + ACE_ERROR ((LM_ERROR, "Warning: ACTs not implemented for Global.\n")); + } + break; + + default: + // Non-timer event subscription. + if (this->register_event (*iter, + group_type, + cgroup_index, + dgroup_index, + crep_index) == -1) + return -1; + break; + } + } + + // We may not use all of the consumer reps if there are repeats: + // (A+B)|(B+C). Must update n_consumer_reps_ so we don't try to + // unsubscribe a blank rep during disconnect. + if (crep_index < n_consumer_reps_) + n_consumer_reps_ = crep_index; + + return 0; +} + +int +ACE_ES_Consumer_Correlation::register_deadline_timeout (RtecEventChannelAdmin::Dependency &dependency, + RtecEventComm::EventType group_type, + int cgindex, + int dgindex, + int &trep_index) +{ + // new_timeout will be returned as an ACT. When executed, it will + // forward *iter.event_ to the consumer. + ACE_ES_Consumer_Rep_Timeout *new_timeout = &timer_reps_[trep_index++]; + new_timeout->init (this, dependency); + new_timeout->correlation_type (ACE_ES_Consumer_Rep::DEADLINE_TIMEOUT); + // Deadline timers do not need type ids. + + switch (group_type) + { + case ACE_ES_CONJUNCTION_DESIGNATOR: + // Reps keep pointers back to the groups that they're deadlines for. + new_timeout->add_disjunction_group (conjunction_groups_[cgindex]); + // Groups keep references to the deadline timers for rescheduling. + if (conjunction_groups_[cgindex].set_deadline_timeout (new_timeout) == -1) + return -1; + break; + + case ACE_ES_DISJUNCTION_DESIGNATOR: + new_timeout->add_disjunction_group (disjunction_groups_[dgindex]); + if (disjunction_groups_[dgindex].set_deadline_timeout (new_timeout) == -1) + return -1; + break; + + case ACE_ES_GLOBAL_DESIGNATOR: + ACE_ERROR_RETURN ((LM_ERROR, "No global deadline timeouts, yet!\n"), -1); + } + + return 0; +} + +int +ACE_ES_Consumer_Correlation::register_interval_timeout (RtecEventChannelAdmin::Dependency &dependency, + RtecEventComm::EventType group_type, + int cgindex, + int /* dgindex */, + int &trep_index) +{ + // new_timeout will be returned as an ACT. When executed, it will + // forward *iter.event_ to the consumer. + ACE_ES_Consumer_Rep_Timeout *new_timeout = &timer_reps_[trep_index++]; + new_timeout->init (this, dependency); + new_timeout->type_id (this->new_type_id ()); + + switch (group_type) + { + case ACE_ES_CONJUNCTION_DESIGNATOR: + // If it's a conjunction, then we need to perform correlations + // on the timeout. + new_timeout->correlation_type (ACE_ES_Consumer_Rep::CORRELATE); + conjunction_groups_[cgindex].add_type (new_timeout->type_id ()); + break; + + case ACE_ES_DISJUNCTION_DESIGNATOR: + case ACE_ES_GLOBAL_DESIGNATOR: + new_timeout->correlation_type (ACE_ES_Consumer_Rep::NO_CORRELATION); + break; + } + + // Schedule the timeout. + if (correlation_module_->schedule_timeout (new_timeout) == -1) + return -1; + else + return 0; +} + +// Search <creps> for a rep matching <dependency>. If one is not +// found, allocate one. All returned reps should have the appropriate +// type_id set. +ACE_ES_Consumer_Rep * +ACE_ES_Consumer_Correlation::get_consumer_rep (RtecEventChannelAdmin::Dependency &dependency, + int &crep_index) +{ + ACE_ES_Consumer_Rep *rep = 0; + + // Step through all existing consumer reps. + for (int x=0; x < crep_index; x++) + { + // If <dependency> matches any previously subscribed consumer + // reps, we'll reuse it. + if (consumer_reps_[x]->dependency ()->event_.type_ == dependency.event_.type_ +#if defined(ACE_ES_LACKS_ORB) + && consumer_reps_[x]->dependency ()->event_.source_ == + dependency.event_.source_ +#endif /* ACE_ES_LACKS_ORB */ +) + { + rep = consumer_reps_[x]; + break; + } + } + + // Check if we didn't find it. + if (rep == 0) + { + if (crep_index >= n_consumer_reps_) + ACE_ERROR_RETURN ((LM_ERROR, "Too many event registrations.\n"), 0); + // Allocate a new rep and set its type id. + rep = consumer_reps_[crep_index]; + crep_index++; + rep->init (this, dependency); + rep->type_id (this->new_type_id ()); + } + + return rep; +} + +int +ACE_ES_Consumer_Correlation::new_type_id (void) +{ + int type_id = type_id_index_; + if (++type_id_index_ >= ACE_ES_MAX_SUBSCRIPTIONS) + ACE_ERROR_RETURN ((LM_ERROR, "ACE_ES_MAX_SUBSCRIPTIONS exceeded.\n"),0); + else + return type_id; +} + +int +ACE_ES_Consumer_Correlation::register_event (RtecEventChannelAdmin::Dependency &dependency, + RtecEventComm::EventType group_type, + int cgindex, + int dgindex, + int &crep_index) +{ + // These are stored in the subscription module data structures. + ACE_ES_Consumer_Rep *consumer_rep = this->get_consumer_rep (dependency, crep_index); + + if (consumer_rep == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Consumer_Correlation::register_event"), -1); + + switch (group_type) + { + case ACE_ES_CONJUNCTION_DESIGNATOR: + // If it's a conjunction, then we need to perform correlations + // on the object. Otherwise, NO_CORRELATION is set by default. + consumer_rep->correlation_type (ACE_ES_Consumer_Rep::CORRELATE); + conjunction_groups_[cgindex].add_type (consumer_rep->type_id ()); + break; + + case ACE_ES_DISJUNCTION_DESIGNATOR: + consumer_rep->add_disjunction_group (disjunction_groups_[dgindex]); + break; + + case ACE_ES_GLOBAL_DESIGNATOR: + ACE_ERROR ((LM_ERROR, "ACE_ES_Consumer_Correlation::register_event: " + "ACE_ES_GLOBAL_DESIGNATOR not implemented.\n")); + break; + } + + // Subscribe the consumer_rep to the suppliers. + if (correlation_module_->subscribe (consumer_rep) == -1) + return -1; + else + return 0; +} + +int +ACE_ES_Consumer_Correlation::disconnecting (void) +{ + // If we were forwarding events, disconnect as a supplier. + if (connected_) + { + CORBA::Environment env; + channel_->disconnect_push_consumer (env); + if (env.exception () != 0) + ACE_ERROR ((LM_ERROR, "ACE_ES_Consumer_Correlation::disconnecting failed.\n")); + } + + for (int x=0; x < n_timer_reps_; x++) + correlation_module_->cancel_timeout (&timer_reps_[x]); + + for (int y=0; y < n_consumer_reps_; y++) + if (consumer_reps_[y] != 0) + consumer_reps_[y]->disconnect (); + + return 0; +} + +ACE_ES_Dispatch_Request * +ACE_ES_Consumer_Correlation::push (ACE_ES_Consumer_Rep *cr, + ACE_ES_Event_Container *event) +{ + ACE_TIMEPROBE (" ACE_ES_Consumer_Correlation::push, enter"); + + // Check if this event needs any correlating, or if it should just + // be forwarded real fast-like. + switch (cr->correlation_type ()) + { + case ACE_ES_Consumer_Rep::NO_CORRELATION: + { + // Calls reschedule on all disjunction groups it belongs to. + cr->reschedule_deadlines (); + + ACE_TIMEPROBE (" Consumer_Correlation::push, determine NO CORR."); + ACE_ES_Dispatch_Request *request = + new ACE_ES_Dispatch_Request (consumer_, event, cr->dependency ()->rt_info); + ACE_TIMEPROBE (" Consumer_Correlation::push, NO_CORR: alloc"); + + if (request == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Consumer_Correlation::push"), 0); + + return request; + } + + case ACE_ES_Consumer_Rep::CORRELATE: + return this->correlate (cr, event); + + case ACE_ES_Consumer_Rep::DEADLINE_TIMEOUT: + { + ACE_ES_Dispatch_Request *request = + new ACE_ES_Dispatch_Request (consumer_, cr->dependency ()->rt_info); + + if (request == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Consumer_Correlation::push"), 0); + + // Add the deadline timeout to the outbox. + request->event_set () += event; + + // Add any pending events to the outbox. + cr->top_group ()->add_events (&(request->event_set ()), + pending_events_, pending_flags_); + + return request; + } + + default: + ACE_ERROR_RETURN ((LM_ERROR, "ACE_ES_Consumer_Correlation::push:" + " unknown correlation type\n"), 0); + } +} + +// @@ If we're just event forwarding, then no pending_events_ need to +// be kept! I'll add this optimization later. +ACE_ES_Dispatch_Request * +ACE_ES_Consumer_Correlation::correlate (ACE_ES_Consumer_Rep *cr, + ACE_ES_Event_Container *event) +{ + // If the consumer has specified correlation criteria, then we must + // first acquire the mutex. + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Consumer_Correlation::push"), 0); + + // Add the new event to the pending events. + pending_events_[cr->type_id ()] += event; + + // Set the bit corresponding to the arrived event. + // This should be pending_flags_->event_arrived (index); + ACE_SET_BITS (pending_flags_, ACE_INT2BIT[cr->type_id ()]); + + ACE_ES_Dispatch_Request *request = 0; + Event_Set *outbox = 0; + // Since add_events changes pending_flags_, we need to keep this + // for all iterations through the conjunction groups. + u_long freeze_pending_flags = pending_flags_; + + for (int x=0; x < n_conjunction_groups_; x++) + { + if (conjunction_groups_[x].should_forward (freeze_pending_flags)) + { + // If there is a deadline timer for this conjunction group, + // this will reschedule them. + conjunction_groups_[x].reschedule_deadline (); + + // First time in, allocate the new dispatch request. + if (request == 0) + { + request = + new ACE_ES_Dispatch_Request (consumer_, + cr->dependency ()->rt_info); + if (request == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Consumer_Correlation::correlate"), 0); + outbox = &(request->event_set ()); + } + + // Add each of the pending events for this correlation to + // the outgoing dispatch request. If outbox == 0, then + // this will just clear any pending events. + conjunction_groups_[x].add_events (outbox, + pending_events_, + pending_flags_); + } + } + + return request; +} + + +// ************************************************************ + +ACE_ES_Consumer_Rep::~ACE_ES_Consumer_Rep (void) +{ +} + +void +ACE_ES_Consumer_Rep::execute (void) +{ + ACE_ERROR ((LM_ERROR, "Warning! ACE_ES_Consumer_Rep::execute called.\n")); +} + +// ************************************************************ + +void +ACE_ES_Consumer_Rep_Timeout::execute (void) +{ + ACE_TIMEPROBE (" Consumer_Rep_Timeout::execute"); + if (this->receiving_events ()) + { + CORBA::Environment __env; + ACE_Time_Value tv = ACE_OS::gettimeofday (); + timeout_event_->creation_time_ = tv.sec () * 10000000 + tv.usec () * 10; + correlation_->correlation_module_->push (this, timeout_event_, __env); + if (__env.exception () != 0) + ACE_ERROR ((LM_ERROR, "ACE_ES_Consumer_Rep_Timeout::execute: unexpected exception.\n")); + } +} + +// ************************************************************ + +ACE_ES_Subscription_Module::ACE_ES_Subscription_Module (ACE_EventChannel *channel) + : channel_ (channel), + up_ (0), + down_ (0) +{ +} + +void +ACE_ES_Subscription_Module::open (ACE_ES_Correlation_Module *up, + ACE_ES_Supplier_Module *down) +{ + // Brilliant. + up_ = up; + down_ = down; +} + +ACE_ES_Subscription_Module::~ACE_ES_Subscription_Module (void) +{ +} + +// When a supplier connects, we step through each of its +// publications. For each event type published, we allocate a set in +// the suppliers type collection. Then we build a subscribers list +// starting with any consumers having a type-based subscription in the +// global type collection. +void +ACE_ES_Subscription_Module::connected (ACE_Push_Supplier_Proxy *supplier, + CORBA::Environment &_env) +{ + RtecEventComm::EventSourceID sid = 0; + // We will record the source_id for later usage. + { + ACE_ES_WGUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_THROW (SYNC_ERROR); + // @@ TODO: Orbix parameters + // (0, CORBA::COMPLETED_NO, "ACE_ES_Subscription_Module::connected")); + + if (all_suppliers_.insert (supplier) == -1) + ACE_ERROR ((LM_ERROR, "ACE_ES_Subscription_Module insert failed.\n")); + + // For every type that this supplier generates, bind a new + // Type_Subscribers to the type in the supplier proxy's type + // collection. + RtecEventChannelAdmin::PublicationSet &publications = supplier->qos ().publications_; + + sid = publications[0].event_.source_; + for (CORBA::ULong index=0; index < publications.length (); index++) + { + // Check to make sure an RT_Info was specified. +#if 0 + // @@ TODO: We should check if rt_info is a valid handle_t. + if (publications[index].dependency_info_.rt_info.value() == 0) + { + ACE_ERROR ((LM_ERROR, "Found a SupplierQOS::dependency_info_.rt_info_ == 0\n")); + continue; + } +#endif + + RtecEventComm::EventType &event_type = publications[index].event_.type_; + + // Check to make sure a type was specified. + if (event_type == ACE_ES_EVENT_ANY) + { + ACE_ERROR ((LM_ERROR, "ACE_ES_Subscription_Module::connected: " + "source is publishing ACE_ES_EVENT_ANY.\n")); + continue; + } + + // Make a new set for the proxy. Include the dependency + // info describing the RT_Method that generates this event. + // This object will hold all the consumers that subscribe to + // this publication. + ACE_ES_Subscription_Info::Type_Subscribers *new_subscribers = + new ACE_ES_Subscription_Info::Type_Subscribers (&(publications[index].dependency_info_)); + + if (new_subscribers == 0) + { + ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_ES_Subscription_Module::connected")); + return; + } + + // Check the global type collection for consumers that register + // before suppliers. + ACE_ES_Subscription_Info::Type_Subscribers *existing_subscribers; + if (type_subscribers_.find (event_type, existing_subscribers) == 0) + { + // Iterate through existing subscribers. + ACE_ES_Subscription_Info::Subscriber_Set_Iterator iter (existing_subscribers->consumers_); + + for (ACE_ES_Consumer_Rep **proxy = 0; + iter.next (proxy) != 0; + iter.advance ()) + { + // Each existing subscriber will get appended to the + // new subscribers list. Dependencies are updated. + + // @@ TODO: Handle exceptions. + ACE_Scheduler_Factory::server()->add_dependency + ((*proxy)->dependency()->rt_info, + new_subscribers->dependency_info_->rt_info, + new_subscribers->dependency_info_->number_of_calls, + _env); + ACE_DEBUG ((LM_DEBUG, "%s - add_dependency (%d,%d,%d)\n", + "ACE_ES_Priority_Timer::schedule_timer", + (*proxy)->dependency()->rt_info, + new_subscribers->dependency_info_->rt_info, + new_subscribers->dependency_info_->number_of_calls)); + if (_env.exception () != 0) + return; + // @@ TODO use the ACE_TRY macros. + + if (new_subscribers->consumers_.insert (*proxy) == -1) + { + ACE_ERROR ((LM_ERROR, + "%p: add_dependency/insert failed.\n", + "ACE_ES_Subscription_Module::connected")); + continue; + } + } + } + + // Put the new subscribers for this event type in the supplier + // proxy's type map. + if (supplier->subscription_info ().type_subscribers_. + bind (event_type, new_subscribers) != 0) + { + // This may occur with a double bind, I think. + ACE_ERROR ((LM_ERROR, "%p can't initialize type.\n", + "ACE_ES_Subscription_Module::connected")); + delete new_subscribers; + continue; + } + } + } // release lock + + // Reregister any consumers that tried to subscribe before this + // supplier connected. + // NOTE: We used to call back the supplier here (using + // supplier->source_id()), this is ineffective and leads to all kind + // of dead-locks (the supplier is blocked and waiting for us). + // We use the information on the publications to get the source_id. + this->reregister_consumers (sid); +} + +// Step through each of the source_subscribers looking for consumers +// that registered for <source> before <source> connected. +void +ACE_ES_Subscription_Module::reregister_consumers (RtecEventComm::EventSourceID source_id) +{ + ACE_ES_Subscription_Info::Subscriber_Set *subscribers = 0; + if (source_subscribers_.find (source_id, subscribers) == -1) + // Not found. + return; + + ACE_ES_Subscription_Info::Subscriber_Set_Iterator iter (*subscribers); + + // Try to reregister all consumers. + for (ACE_ES_Consumer_Rep **consumer = 0; + iter.next (consumer) != 0; + iter.advance ()) + if (this->subscribe (*consumer) == -1) + ACE_ERROR ((LM_ERROR, "%p.\n" "ACE_ES_Subscription_Module::reregister_consumers")); +} + + +void +ACE_ES_Subscription_Module::disconnecting (ACE_Push_Supplier_Proxy *supplier, + CORBA::Environment &_env) +{ + ACE_ES_WGUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_THROW (SYNC_ERROR); + // @@ TODO: Orbix parameters + // (0, CORBA::COMPLETED_NO, "ACE_ES_Subscription_Module::disconnected")); + + if (all_suppliers_.remove (supplier) == -1) + ACE_THROW (SUBSCRIPTION_ERROR); + // @@ TODO: Orbix parameters. + // (0, CORBA::COMPLETED_NO, "ACE_ES_Subscription_Module remove failed")); + + // Remove all consumers from the supplier's source-based subscription lists. + ACE_ES_Subscription_Info::Subscriber_Set_Iterator source_iterator + (supplier->subscription_info ().source_subscribers_); + + for (ACE_ES_Consumer_Rep **consumer; + source_iterator.next (consumer) != 0; + source_iterator.advance ()) + (*consumer)->_release (); + + // Get the subscriber list for each type. + ACE_ES_Subscription_Info::Subscriber_Map_Iterator type_map_iterator + (supplier->subscription_info ().type_subscribers_); + + for (ACE_ES_Subscription_Info::Subscriber_Map_Entry *entry; + type_map_iterator.next (entry) != 0; + type_map_iterator.advance ()) + { + // Remove all consumers from the supplier's source-based subscription lists. + ACE_ES_Subscription_Info::Subscriber_Set_Iterator type_iterator + (entry->int_id_->consumers_); + + for (ACE_ES_Consumer_Rep **c; + type_iterator.next (c) != 0; + type_iterator.advance ()) + (*c)->_release (); + } +} + +int +ACE_ES_Subscription_Module::subscribe_all (ACE_ES_Consumer_Rep *) +{ + ACE_ERROR_RETURN ((LM_ERROR, "Consumer tried to register for all" + "events! This is not implemented.\n"), -1); +} + +int +ACE_ES_Subscription_Module::subscribe_source (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID source) +{ + // Step through all Supplier Proxies looking for a match to + // -supplier-. Add the -consumer- to the correct supplier proxy. + Supplier_Iterator iter (all_suppliers_); + + int success = -1; + + for (ACE_Push_Supplier_Proxy **proxy = 0; + iter.next (proxy) != 0; + iter.advance ()) + { + // Operator == checks if <proxy> is a proxy for <supplier>. + if ((**proxy) == source) + { + ACE_ES_WGUARD mon ((*proxy)->subscription_info ().lock_); + + ACE_ES_Subscription_Info::Subscriber_Set &set = + (*proxy)->subscription_info ().source_subscribers_; + + // Insert the consumer to the supplier's subscription set for + // the type. + int insert_result = set.insert (consumer); + switch (insert_result) + { + case -1: + // Error. + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "Subscription Module::subscribe_source"), -1); + case 0: + default: + { + // Increment the consumer rep's reference count. + consumer->_duplicate (); + // Success. + // Add each of the supplier's dependency infos to the + // consumer's dependency list. + ACE_ES_Subscription_Info::Subscriber_Map_Iterator iter2 + ((*proxy)->subscription_info ().type_subscribers_); + + // Delete all type collections. + for (ACE_ES_Subscription_Info::Subscriber_Map_Entry *temp = 0; + iter2.next (temp) != 0; + iter2.advance ()) + { + ACE_TRY + { + ACE_Scheduler_Factory::server()->add_dependency + (consumer->dependency()->rt_info, + temp->int_id_->dependency_info_->rt_info, + temp->int_id_->dependency_info_->number_of_calls, + ACE_TRY_ENV); + ACE_CHECK_ENV; + + ACE_DEBUG ((LM_DEBUG, + "%s - add_dependency (%d,%d,%d)\n", + "ACE_ES_Priority_Timer::subscribe_source", + consumer->dependency()->rt_info, + temp->int_id_->dependency_info_->rt_info, + temp->int_id_->dependency_info_->number_of_calls)); + } + ACE_CATCHANY + { + ACE_TRY_ENV.print_exception ("error adding dependency"); + return -1; + } + ACE_ENDTRY; + } + } + + case 1: + // Already there. + success = 0; + break; + } + } + } + + // Add the consumer to the global source subscribers list. + if (success == -1) + return ACE_ES_Subscription_Info::insert_or_allocate (source_subscribers_, + consumer, + source); + else + return success; +} + +// Step through all Supplier Proxies. For each proxy, if it generates +// <type>, add <consumer> to its subscription info. +int +ACE_ES_Subscription_Module::subscribe_type (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type) +{ + // First insert <consumer> into the global type collection set + // corresponding to <type>. The type collection will only be used + // when suppliers register late. + if (ACE_ES_Subscription_Info::insert_or_allocate (type_subscribers_, + consumer, type) == -1) + return -1; + + consumer->_duplicate (); + + Supplier_Iterator iter (all_suppliers_); + + for (ACE_Push_Supplier_Proxy **proxy = 0; + iter.next (proxy) != 0; + iter.advance ()) + { + ACE_ES_WGUARD mon ((*proxy)->subscription_info ().lock_); + // Insert the consumer to the supplier's subscription set for + // the type. If the supplier does not publish this type, the + // operation will fail. If this succeeds, dependency_info will + // be added to the consumer. + RtecScheduler::Dependency_Info *dependency_info; + if (ACE_ES_Subscription_Info::insert_or_fail + ((*proxy)->subscription_info ().type_subscribers_, + consumer, type, dependency_info) == 0) + { + consumer->_duplicate (); + // Success. Add the supplier dependency info to the + // consumer's dependency list. + // @@ TODO handle exceptions. + ACE_TRY + { + ACE_Scheduler_Factory::server()->add_dependency + (consumer->dependency ()->rt_info, + dependency_info->rt_info, + dependency_info->number_of_calls, + ACE_TRY_ENV); + ACE_DEBUG ((LM_ERROR, "%s - add_dependency (%d,%d,%d)\n", + "ACE_ES_Priority_Timer::schedule_timer - ", + consumer->dependency ()->rt_info, + dependency_info->rt_info, + dependency_info->number_of_calls)); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "Subscription_Module::subscribe_type:" + " add_dependency failed.\n")); + return -1; + } + ACE_ENDTRY; + } + } + + return 0; +} + +int +ACE_ES_Subscription_Module::subscribe_source_type (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID source, + RtecEventComm::EventType type) +{ + // Step through all Supplier Proxies looking for a match to + // <supplier>. Once we find one, find the correct set for the + // specified type. Add the <consumer> to that set. + Supplier_Iterator iter (all_suppliers_); + + int success = -1; + + for (ACE_Push_Supplier_Proxy **proxy = 0; + iter.next (proxy) != 0; + iter.advance ()) + { + ACE_ES_WGUARD mon ((*proxy)->subscription_info ().lock_); + + if ((**proxy) == source) + { + // Insert the consumer to the supplier's subscription set for + // the type. + RtecScheduler::Dependency_Info *dependency_info; + int insert_result = ACE_ES_Subscription_Info::insert_or_fail + ((*proxy)->subscription_info().type_subscribers_, + consumer, type, dependency_info); + + switch (insert_result) + { + case -1: + // Error. + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "Subscription Module::subscribe_source_type"), -1); + case 0: + default: + { + // Success. + // Add the supplier to the consumer's dependency list. + // @@ TODO handle exceptions. + ACE_TRY + { + ACE_Scheduler_Factory::server()->add_dependency + (consumer->dependency ()->rt_info, + dependency_info->rt_info, + dependency_info->number_of_calls, + ACE_TRY_ENV); + ACE_DEBUG ((LM_ERROR, "%s - add_dependency (%d,%d,%d)\n", + "ACE_Subscription_Module::subscribe_source_type - ", + consumer->dependency ()->rt_info, + dependency_info->rt_info, + dependency_info->number_of_calls)); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, "Subscription_Module::subscribe_source_type:" + " add_dependency failed.\n"), + -1); + } + ACE_ENDTRY; + consumer->_duplicate (); + } + /* FALLTHROUGH */ + case 1: + success = 0; + + // Already there. + break; + } + + } + } + + if (success == -1) + // If we failed to find a source, insert this consumer in the + // global source subscriber list. + { + if (ACE_ES_Subscription_Info::insert_or_allocate (source_subscribers_, + consumer, + source) == 0) + { + consumer->_duplicate (); + return 0; + } + else + return -1; + } + else + return success; +} + +// <consumer> contains information for one type of subscription. +// Delegate to the appropriate method for subscription. +int +ACE_ES_Subscription_Module::subscribe (ACE_ES_Consumer_Rep *consumer) +{ + // We could have finer granularity by putting RGUARDs in some of the + // subscribe methods. + ACE_ES_WGUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Subscription_Module::subscribe"), -1); + + int result = 0; + RtecEventComm::Event &event = consumer->dependency ()->event_; + + if (event.source_ == 0) + // Not source-based subscription. + { + if (event.type_ == ACE_ES_EVENT_ANY) + result = this->subscribe_all (consumer); + else + result = this->subscribe_type (consumer, event.type_); + } + else + // Source-based subscription. + { + if (event.type_ == ACE_ES_EVENT_ANY) + result = this->subscribe_source (consumer, event.source_); + else + result = this->subscribe_source_type (consumer, event.source_, event.type_); + } + + return result; +} + +int +ACE_ES_Subscription_Module::unsubscribe (ACE_ES_Consumer_Rep *consumer) +{ + // We could have finer granularity by putting RGUARDs in some of the + // unsubscribe methods. + ACE_ES_WGUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Subscription_Module::unsubscribe"), -1); + + RtecEventComm::Event &event = consumer->dependency ()->event_; + + if (event.type_ != ACE_ES_EVENT_ANY) + { + // Remove the consumer from the global type-based subscription list. + if (ACE_ES_Subscription_Info::remove (type_subscribers_, + consumer, event.type_) == 0) + consumer->_release (); + } + else + // Remove the consumer from the global source-based subscription list. + if (ACE_ES_Subscription_Info::remove (source_subscribers_, + consumer, event.source_) == 0) + consumer->_release (); + + return 0; + + /* + + This old code manually removed the consumer from the subscription + lists. Now we do lazy removal. + + int result = 0; + + if (CORBA::is_nil (event.source_)) + { + if (event.type_ == ACE_ES_EVENT_ANY) + result = this->unsubscribe_all (consumer); + else + result = this->unsubscribe_type (consumer, event.type_); + } + else + { + if (event.type_ == ACE_ES_EVENT_ANY) + result = this->unsubscribe_source (consumer, event.source_); + else + result = this->unsubscribe_source_type (consumer, event.source_, event.type_); + } + return result; + */ +} + +int +ACE_ES_Subscription_Module::unsubscribe_all (ACE_ES_Consumer_Rep *) +{ + return 0; +} + +int +ACE_ES_Subscription_Module::unsubscribe_type (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type) +{ + // Step through all Supplier Proxies trying to remove the + // consumer-type pair. ACE_ES_Subscription_Info::remove will fail + // if the supplier does not generate <type>, but that's ok. + Supplier_Iterator iter (all_suppliers_); + + for (ACE_Push_Supplier_Proxy **proxy = 0; + iter.next (proxy) != 0; + iter.advance ()) + { + ACE_ES_WGUARD mon ((*proxy)->subscription_info ().lock_); + + // This remove will be harmless if the supplier does not + // generate <type>. + ACE_ES_Subscription_Info::remove ((*proxy)->subscription_info ().type_subscribers_, + consumer, type); + } + + return 0; +} + +int +ACE_ES_Subscription_Module::unsubscribe_source (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID source) +{ + Supplier_Iterator iter (all_suppliers_); + + for (ACE_Push_Supplier_Proxy **proxy = 0; + iter.next (proxy) != 0; + iter.advance ()) + { + ACE_ES_WGUARD mon ((*proxy)->subscription_info ().lock_); + + if ((**proxy) == source) + { + ACE_ES_Subscription_Info::Subscriber_Set &set = + (*proxy)->subscription_info ().source_subscribers_; + if (set.remove (consumer) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "Subscription Module::unsubscribe_source"), -1); + } + } + + return 0; +} + +int +ACE_ES_Subscription_Module::unsubscribe_source_type (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID source, + RtecEventComm::EventType type) + +{ + Supplier_Iterator iter (all_suppliers_); + + // Step through all supplier proxies looking for a match to the + // consumer's event.source_. This is the same as unsubscribe_type, + // only we can check the source first. + for (ACE_Push_Supplier_Proxy **proxy = 0; + iter.next (proxy) != 0; + iter.advance ()) + // If the proxy matches the source id we're looking for, try to + // remove <consumer> from the proxy's <event.type_> set. + if ((**proxy) == source) + { + ACE_ES_WGUARD mon ((*proxy)->subscription_info ().lock_); + + // Continue in spite of errors. + ACE_ES_Subscription_Info::remove ((*proxy)->subscription_info ().type_subscribers_, + consumer, type); + } + + return 0; +} + +void +ACE_ES_Subscription_Module::push (ACE_Push_Supplier_Proxy *source, + ACE_ES_Event_Container *event, + CORBA::Environment &) +{ + ACE_TIMEPROBE (" deliver to Subscription Module"); + // These are all inline function calls. + if (this->push_source (source, event) == -1) + return; + + ACE_TIMEPROBE (" begin push_source_type"); + + if (this->push_source_type (source, event) == -1) + return; + + ACE_TIMEPROBE (" end push_source_type"); +} + +void +ACE_ES_Subscription_Module::shutdown (void) +{ + ACE_ES_WGUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_ERROR ((LM_ERROR, "%p.\n", + "ACE_ES_Subscription_Module::unsubscribe")); + + // Remove all type_subscribers_ and source_subscribers_. + + ACE_ES_Subscription_Info::Subscriber_Map_Iterator type_iter (type_subscribers_); + for (ACE_ES_Subscription_Info::Subscriber_Map_Entry *entry; + type_iter.next (entry) != 0; + type_iter.advance ()) + { + ACE_ES_Subscription_Info::Subscriber_Set_Iterator ts_iter (entry->int_id_->consumers_); + + for (ACE_ES_Consumer_Rep **consumer = 0; + ts_iter.next (consumer) != 0; + ts_iter.advance ()) + (*consumer)->_release (); + + delete entry->int_id_; + } + + ACE_ES_Subscription_Info::SourceID_Map_Iterator source_iter (source_subscribers_); + + for (ACE_ES_Subscription_Info::SourceID_Map_Entry *entry2; + source_iter.next (entry2) != 0; + source_iter.advance ()) + { + ACE_ES_Subscription_Info::Subscriber_Set_Iterator ss_iter (*entry2->int_id_); + + for (ACE_ES_Consumer_Rep **consumer = 0; + ss_iter.next (consumer) != 0; + ss_iter.advance ()) + (*consumer)->_release (); + + delete entry2->int_id_; + } + + // We don't need to do anything to all_suppliers_ since the supplier + // module should have disconnected all suppliers. To be more + // independent from the supplier module, this method should iterate + // through all suppliers and call this->disconnecting. + up_->shutdown (); +} + +// ************************************************************ + +ACE_ES_Supplier_Module::ACE_ES_Supplier_Module (ACE_EventChannel *channel) : + all_suppliers_ (), + lock_ (), + me_ (this), + up_ (0), + channel_ (channel) +{ +} + +void +ACE_ES_Supplier_Module::open (ACE_ES_Subscription_Module *up) +{ + // There is the theory of the Mobius, a twist, in the fabric of + // space, where time becomes a loop, where time becomes a loop. + up_ = up; +} + +void +ACE_ES_Supplier_Module::connected (ACE_Push_Supplier_Proxy *supplier, + CORBA::Environment &_env) +{ + channel_->report_connect (ACE_EventChannel::SUPPLIER); + up_->connected (supplier, _env); +} + +void +ACE_ES_Supplier_Module::disconnecting (ACE_Push_Supplier_Proxy *supplier, + CORBA::Environment &_env) +{ + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + ACE_THROW (SYNC_ERROR); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, "ACE_ES_Supplier_Module::disconnected")); + + if (all_suppliers_.remove (supplier) == -1) + ACE_THROW (SUBSCRIPTION_ERROR); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, "ACE_ES_Supplier_Module remove failed")); + + up_->disconnecting (supplier, _env); + + if (all_suppliers_.size () <= 0) + { + ACE_DEBUG ((LM_DEBUG, "(%t) No more suppliers connected.\n")); + channel_->report_disconnect (ACE_EventChannel::SUPPLIER); + } + + // IMHO this release is broken: supplier is a parameter, we never + // actually increased its reference count, so we shouldn't decrease + // it. + // CORBA::release (supplier); +} + +void +ACE_ES_Supplier_Module::shutdown (void) +{ + Suppliers copy; + + { + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + return; + + copy = all_suppliers_; + } + + if (copy.size () > 0) + { + Supplier_Iterator iter (copy); + + CORBA::Environment env; + + for (ACE_Push_Supplier_Proxy **proxy = 0; + iter.next (proxy) != 0; + iter.advance ()) + { + (*proxy)->shutdown (); + this->disconnecting (*proxy, env); + } + } + + up_->shutdown (); +} + +RtecEventChannelAdmin::ProxyPushConsumer_ptr +ACE_ES_Supplier_Module::obtain_push_consumer (CORBA::Environment &_env) +{ + ACE_Push_Supplier_Proxy *new_supplier = new ACE_Push_Supplier_Proxy (this); + + if (new_supplier == 0) + ACE_THROW_RETURN (CORBA::NO_MEMORY (CORBA::COMPLETED_NO), 0); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, "ACE_ES_Supplier_Module::obtain_push_consumer")); + + { + ACE_ES_GUARD ace_mon (lock_); + if (ace_mon.locked () == 0) + { + delete new_supplier; + ACE_THROW_RETURN (SYNC_ERROR, 0); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, + // "ACE_ES_Supplier_Module::obtain_push_consumer"), 0); + } + + if (all_suppliers_.insert (new_supplier) == -1) + ACE_ERROR ((LM_ERROR, "ACE_ES_Supplier_Module insert failed.\n")); + } + + return new_supplier->get_ref (); +} + +void +ACE_ES_Supplier_Module::push (ACE_Push_Supplier_Proxy *proxy, + const RtecEventComm::EventSet &event, + CORBA::Environment &_env) +{ + ACE_TRY + { + for (CORBA::ULong i = 0; i < event.length(); ++i) + { + ACE_ES_Event_Container *temp = + new ACE_ES_Event_Container (event[i]); + //RtecEventComm::Event *temp = new RtecEventComm::Event (event); + + if (temp == 0) + ACE_THROW (CORBA::NO_MEMORY (CORBA::COMPLETED_NO)); + // @@ TODO Orbix parameters: + // (0, CORBA::COMPLETED_NO, + // "ACE_ES_Supplier_Module::obtain_push_consumer")); + + // This will guarantee that release gets called when we exit + // the scope. + ACE_ES_Event_Container_var event_copy (temp); + temp->_release (); + ACE_TIMEPROBE (" deliver to Supplier Module (thru Supplier Proxy)"); + up_->push (proxy, event_copy, ACE_TRY_ENV); + ACE_CHECK_ENV; + } + } + ACE_CATCH (RtecEventComm::Disconnected, d) + { + ACE_ERROR ((LM_ERROR, "%p Disconnected.\n", + "ACE_ES_Supplier_Module::push")); + ACE_RETHROW; + } + ACE_CATCH (RtecEventChannelAdmin::TypeError, t) + { + ACE_ERROR ((LM_ERROR, "%p Type Error.\n", + "ACE_ES_Supplier_Module::push")); + ACE_RETHROW; + } + ACE_CATCH (CORBA::NO_MEMORY, e) + { + ACE_ERROR ((LM_ERROR, "%p No Memory.\n", + "ACE_ES_Supplier_Module::push")); + ACE_RETHROW; + } + ACE_CATCH (CORBA::SystemException, e) + { + ACE_ERROR ((LM_ERROR, "%p CORBA System Exception.\n", + "ACE_ES_Supplier_Module::push")); + ACE_RETHROW; + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "ACE_ES_Supplier_Module::push: " + "Unknown exception.\n")); + ACE_RETHROW; + } + ACE_ENDTRY; +} + +// ************************************************************ + +ACE_ES_Priority_Timer::ACE_ES_Priority_Timer (void) +{ +} + +int +ACE_ES_Priority_Timer::connected (RtecScheduler::handle_t rt_info) +{ + RtecScheduler::OS_Priority thread_priority; + RtecScheduler::Sub_Priority subpriority; + RtecScheduler::Preemption_Priority preemption_priority; + + ACE_TRY + { + ACE_TIMEPROBE (" connected - priority requested"); + ACE_Scheduler_Factory::server ()->priority + (rt_info, thread_priority, + subpriority, preemption_priority, ACE_TRY_ENV); + ACE_CHECK_ENV; + ACE_TIMEPROBE (" connected - priority obtained"); +#if 0 + ACE_ERROR_RETURN ((LM_ERROR, "%p RtecScheduler::Scheduler::priority failed.\n", + "ACE_ES_Priority_Timer::connected"), -1); +#endif /* 0 */ + } + ACE_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, + "%p RtecScheduler::Scheduler::priority failed.\n", + "ACE_ES_Priority_Timer::connected"), -1); + } + ACE_ENDTRY; + + // Just make sure the ORB allocates resources for this priority. + if (ACE_Task_Manager::instance()->GetReactorTask (preemption_priority) == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", + "ACE_ES_Priority_Timer::connected"), -1); + + return 0; +} + +int +ACE_ES_Priority_Timer::handle_timeout (const ACE_Time_Value &, + const void *vp) +{ + ACE_ES_Timer_ACT *act = (ACE_ES_Timer_ACT *) vp; + + if (act == 0) + ACE_ERROR_RETURN ((LM_ERROR, "ACE_ES_Priority_Timer::handle_timeout: " + "received act == 0!!!.\n"), 0); + + ACE_TIMEPROBE ("ES_Priority_Queue - start execute"); + + act->execute (); + + ACE_TIMEPROBE ("ES_Priority_Queue - end execute"); + + return 0; +} + +// ************************************************************ + +const char * +ACE_ES_Consumer_Name (const RtecEventChannelAdmin::ConsumerQOS &qos) +{ + // The first dependency should designate a correlation group. + + ACE_TRY + { + ACE_TIMEPROBE (" Consumer_Name - priority requested"); + RtecScheduler::RT_Info* rt_info = ACE_Scheduler_Factory::server ()->get + (qos.dependencies[1].rt_info, ACE_TRY_ENV); + ACE_CHECK_ENV; + ACE_TIMEPROBE (" Consumer_Name - priority obtained"); + + return rt_info->entry_point; + } + ACE_CATCHANY + { + return "no-name"; + } + ACE_ENDTRY; + ACE_NOTREACHED (return "no-name"); +} + +// ************************************************************ + +void +dump_event (const RtecEventComm::Event &event) +{ + ACE_DEBUG ((LM_DEBUG, "source_ = %d " + "type_ = %d " + "time_ = %u.\n", + (void*)event.source_, + event.type_, + // The divide-by-1 is for ACE_U_LongLong support. + event.creation_time_ / 1)); +} + +// ************************************************************ + +#if defined(ACE_ES_LACKS_ORB) +void +dump_sequence (const ACE_CORBA_Sequence<ACE_ES_Event> &seq) +{ + for (CORBA::ULong index=0; index < seq.length (); index++) + ::dump_event (seq[index]); +} +#endif /* ACE_ES_LACKS_ORB */ + +// ************************************************************ + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) + +#if defined (ACE_ES_LACKS_ORB) +//template class ACE_CORBA_Sequence<RtecEventComm::Event>; +// template class ACE_CORBA_Sequence<RtecEventComm::Event_var>; +template class ACE_CORBA_Sequence<RtecEventChannelAdmin::Dependency>; +template class ACE_CORBA_Sequence<ACE_ES_Publication>; +// For ACE_ES_Event_Container_var. +template class ACE_CORBA_var<ACE_ES_Event_Container>; + +// Used in Event_Channel.cpp. +template void operator+=(ACE_CORBA_Sequence<ACE_ES_Event> &, + ACE_ES_Event const &); +#endif /* ACE_ES_LACKS_ORB */ + +template class ACE_Atomic_Op<ACE_ES_MUTEX, int>; +template class ACE_Map_Entry<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT>; +template class ACE_Map_Entry<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT>; +template class ACE_Map_Iterator<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Iterator<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Manager<ACE_ES_Subscription_Info::EXT, ACE_ES_Subscription_Info::INT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Map_Manager<ACE_ES_Subscription_Info::sEXT, ACE_ES_Subscription_Info::sINT, ACE_ES_Subscription_Info::SYNCH>; +template class ACE_Node<ACE_ES_Consumer_Rep *>; +template class ACE_Node<ACE_Push_Consumer_Proxy *>; +template class ACE_Node<ACE_Push_Supplier_Proxy *>; +template class ACE_Unbounded_Set<ACE_ES_Consumer_Rep *>; +template class ACE_Unbounded_Set<ACE_Push_Consumer_Proxy *>; +template class ACE_Unbounded_Set<ACE_Push_Supplier_Proxy *>; +template class ACE_Unbounded_Set_Iterator<ACE_ES_Consumer_Rep *>; +template class ACE_Unbounded_Set_Iterator<ACE_Push_Consumer_Proxy *>; +template class ACE_Unbounded_Set_Iterator<ACE_Push_Supplier_Proxy *>; + +// For ACE_ES_Event_Container_Allocator. +template class ACE_Cached_Allocator<ACE_ES_Event_Container_Chunk, ACE_Null_Mutex>; +template class ACE_Cached_Allocator<ACE_ES_Dispatch_Request_Chunk, ACE_Null_Mutex>; +template class ACE_Cached_Mem_Pool_Node<ACE_ES_Event_Container_Chunk>; +template class ACE_Cached_Mem_Pool_Node<ACE_ES_Dispatch_Request_Chunk>; +template class ACE_Locked_Free_List<ACE_Cached_Mem_Pool_Node<ACE_ES_Event_Container_Chunk>, ACE_Null_Mutex>; +template class ACE_Locked_Free_List<ACE_Cached_Mem_Pool_Node<ACE_ES_Dispatch_Request_Chunk>, ACE_Null_Mutex>; +template class ACE_Free_List<ACE_Cached_Mem_Pool_Node<ACE_ES_Event_Container_Chunk> >; +template class ACE_Free_List<ACE_Cached_Mem_Pool_Node<ACE_ES_Dispatch_Request_Chunk> >; + +template class ACE_ES_Array_Iterator<ACE_ES_Consumer_Rep *>; +template class ACE_ES_Simple_Array<ACE_ES_Consumer_Rep *, 100>; + +template class ACE_CORBA_var<ACE_ES_Event_Container>; + + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/Event_Service/Event_Channel.h b/TAO/orbsvcs/Event_Service/Event_Channel.h new file mode 100644 index 00000000000..da26e4cf0e6 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Event_Channel.h @@ -0,0 +1,1312 @@ +/* -*- C++ -*- */ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// ace ORB +// +// = FILENAME +// Event_Channel +// +// = AUTHOR +// Tim Harrison (harrison@cs.wustl.edu) +// +// = DESCRIPTION +// TAO implementation of the Real Time Event Services. For more +// detailed information, see +// http://www.cs.wustl.edu/~schmidt/oopsla.ps.gz +// +// = NAMING CONVENTIONS +// Some of the naming might be confusing. For instance +// ACE_Push_Consumer_Proxy "is-a" ProxyPushSupplier. To the +// channel, ACE_Push_Consumer_Proxy is a proxy to push consumers. +// To a push consumer, ACE_Push_Consumer_Proxy is a proxy to push +// suppliers. I chose to name classes relative to the Event +// Channel. +// +// ============================================================================ + +#ifndef ACE_EVENT_CHANNEL_H +#define ACE_EVENT_CHANNEL_H + +#include "ace/Containers.h" +#include "ace/Map_Manager.h" + +#include "tao/Timeprobe.h" +#include "Local_ESTypes.h" +#include "CORBA_Utils_T.h" +#include "Task_Manager.h" +#include "ReactorTask.h" + +//ACE_INLINE void operator += (ACE_CORBA_Sequence<RtecEventComm::Event_var> &dest, +// RtecEventComm::Event *item); + +ACE_INLINE int operator == (const RtecEventComm::Event &event1, + const RtecEventComm::Event &event2); +// This operation could be part of the classes, but in order to stay +// CORBA compliant, we're adding them as global operators. + +// ************************************************************ + +class ACE_ES_Event_Container : public RtecEventComm_Event +// = TITLE +// Event Container +// +// = DESCRIPTION +// Basically an ACE_ES_Event with reference counting and +// thread-specific memory allocation. +{ +public: + ACE_ES_Event_Container (void); + // Default construction. + + ~ACE_ES_Event_Container (void); + // Destruction. + + ACE_ES_Event_Container (const ACE_ES_Event_Container &); + // Copy construction. + + ACE_ES_Event_Container (const RtecEventComm::Event &); + // Construction with an event. + + ACE_ES_Event_Container *_duplicate (void); + // Increments ref_count_ and returns this. + + void _release (void); + // Decrements ref_count_ and deletes if 0. + + int operator== (const ACE_ES_Event_Container &event); + // Returns 1 if the two are "equal," 0 otherwise. Determines + // equality using source_ and type_ only. A 0 source_ is a wildcard + // (always equal). A type_ of ACE_ES_EVENT_ANY is also a wildcard. + + void *operator new (size_t nbytes); + // Allocates memory from a thread-specific memory pool. + + void operator delete (void *); + // Returns memory to a thread-specific memory pool. + + void dump (void); + +private: + int ref_count_; +}; + +typedef ACE_CORBA_var<ACE_ES_Event_Container> ACE_ES_Event_Container_var; + +ACE_INLINE void operator += (ACE_CORBA_Sequence<ACE_ES_Event_Container_var> &dest, + ACE_ES_Event_Container *item); + +#if defined(ACE_ES_LACKS_ORB) +// Utility for debugging sequences. +ACE_Svc_Export void dump_sequence (const ACE_CORBA_Sequence<RtecEventComm::Event> &seq); +#endif /* ACE_ES_LACKS_ORB */ + +// Utility for debugging events. +void dump_event (const RtecEventComm::Event &event); + +// ************************************************************ + +class ACE_RTU_Manager +// = TITLE +// ACE RTU Manager +// +// = DESCRIPTION +{ +public: + ACE_RTU_Manager (int active); + // If <active> == 0, everything returns 0. If <active> != 0, RTUs + // galore. + + int should_preempt (void); + // Returns 1 if the current task should preempt itself. Otherwise, + // returns 0. Resets should_preempt to zero. + + void should_preempt (int s); + // Called by the dispatching module when the current task should + // preempt itself. + + void not_done (int nd); + // If <nd> != 0, the current running task will be enqueued at the + // head of its dispatch tail. + + int not_done (void); + // Returns 1 if the current task needs to be dispatched again. + // Resets not_done_ to 0; + + // = Get/set the priority of the current running task. + RtecScheduler::OS_Priority priority (void); + void priority (RtecScheduler::OS_Priority priority); + +private: + int active_; + int should_preempt_; + int not_done_; + RtecScheduler::OS_Priority priority_; +}; + +// ************************************************************ + +// Chesire cat. +class ACE_ES_Priority_Timer; +// Forward declarations. +class ACE_ES_Consumer_Module; +class ACE_ES_Correlation_Module; +class ACE_ES_Subscription_Module; +class ACE_ES_Supplier_Module; +// This forward decl and typedef allow us to remove inheritence later +// on without changing any code. +class ACE_ES_Dispatching_Base; +typedef ACE_ES_Dispatching_Base ACE_ES_Dispatching_Module; + +// ec.. +class ACE_EventChannel : public RtecEventChannelAdmin_EventChannelBOAImpl +// = TITLE +// ACE Event Channel. +// +// = DESCRIPTION +// Implementation of COSS Event Channel. For more detailed +// information, see http://www.cs.wustl.edu/~mda/event.html. +{ +public: + enum { INITIAL_STATE = 0, + CONSUMER = 1, SUPPLIER = 2, + SHUTDOWN = CONSUMER | SUPPLIER }; + + ACE_EventChannel (u_long type = ACE_DEFAULT_EVENT_CHANNEL_TYPE); + // Construction of the given <type>. Check the **_CHANNEL + // enumerations defined below. + + virtual ~ACE_EventChannel (void); + // Calls destroy. + + // = Accessor methods to Event Channel objects. The Event Channel + // acts as a sort of service repository of object references. All + // objects in the Event Service come to this interface to obtain + // object references during initialization. + + virtual RtecEventChannelAdmin::ConsumerAdmin_ptr for_consumers (CORBA::Environment &); + // Consumer administration factory method. + + virtual RtecEventChannelAdmin::SupplierAdmin_ptr for_suppliers (CORBA::Environment &); + // Supplier administration factory method. + + virtual void destroy (CORBA::Environment &); + // Explicitly shut down the channel. + + RtecEventChannelAdmin::EventChannel_ptr get_ref (void); + // Allow transformations to RtecEventChannelAdmin::EventChannel. + + ACE_RTU_Manager *rtu_manager (void); + // Returns a reference to the RTU manager. + + ACE_ES_Priority_Timer *timer (void); + // Timer accessor. + + // = These should be private. + ACE_ES_Consumer_Module *consumer_module_; + ACE_ES_Dispatching_Module *dispatching_module_; + ACE_ES_Correlation_Module *correlation_module_; + ACE_ES_Subscription_Module *subscription_module_; + ACE_ES_Supplier_Module *supplier_module_; + + ACE_ES_Priority_Timer *timer_; + + void report_connect (u_long); + // Consumer or supplier connected. + + void report_disconnect (u_long); + // Consumer or supplier disconnected. + + void shutdown (void); + // Do not call this. The last module has shut down. + +private: + ACE_RTU_Manager *rtu_manager_; + // The RTU manager dude! + + u_long type_; + // Can be any **_CHANNEL. (well, except NO_CHANNEL). + + u_long state_; + // Can be INITIAL_STATE, NO_CONSUMERS, NO_SUPPLIERS, or SHUTDOWN. + + ACE_ES_MUTEX lock_; + // Used to lock shared state. + + RtecEventChannelAdmin::EventChannel_ptr me_; + // CORBA reference to self. + + int destroyed_; + // Ensures this->destory is executed only once. +}; + +// ************************************************************ + +class ACE_ES_Dependency_Iterator +// = TITLE +// ConsumerQOS Iterator +// +// = DESCRIPTION +// This is used by the Event Channel to parse ConsumerDependency objects. +{ +public: + ACE_ES_Dependency_Iterator (RtecEventChannelAdmin::DependencySet &rep); + // Construct and iterator for <rep>. + + int advance_dependency (void); + // Returns 0 if the advance succeeded. Returns -1 if there are no + // more dependencies in the group. + + int parse (void); + // Cache values for n_** methods. + + int n_conjunctions (void); + // Returns the number of conjunction groups in the dependency set. + + int n_disjunctions (void); + // Returns the number of disjunction groups in the dependency set. + + int n_timeouts (void); + // Returns the number of timeouts registered. + + int n_events (void); + // Returns the number of events registered. + + RtecEventChannelAdmin::Dependency &operator *(void); + // Accessor to the current ConsumerDependency pointed to by the + // iterator. + + RtecScheduler::handle_t first_rt_info (void); + // Returns the first RT_Info in the dependencies. + +protected: + RtecScheduler::handle_t rt_info_; + // The first rt_info in the dependencies. + + RtecEventChannelAdmin::DependencySet &rep_; + // Reference to the dependency array. + + int index_; + // Index into rep_. + + RtecEventComm::EventType group_type_; + // The type of the current correlation group. + + int n_conjunctions_; + // Number of conjunction groups. + + int n_disjunctions_; + // Number of disjunction groups. + + int n_timeouts_; + // Number of timeouts registered. + + int n_events_; + // Number of events registered. +}; + +// ************************************************************ + +class ACE_ES_Timer_ACT +// = TITLE +// Timer Asynchronous Completion Token +// +// = DESCRIPTION +// Implements Command pattern with timers. +{ +public: + virtual void execute (void) = 0; +}; + +// ************************************************************ +// Forward decl. +class ACE_ES_Consumer_Rep_Timeout; + +class ACE_ES_Disjunction_Group +// = TITLE +// Disjunction Group +// +// = DESCRIPTION +// Represents a disjunction group, such as (A|B|C). +{ +public: + ACE_ES_Disjunction_Group (void); + // Default construction. + + void set_correlation_module (ACE_ES_Correlation_Module *cm); + // <cm> is needed for rescheduling deadlines. + + void reschedule_deadline (void); + // If deadline_timer_rep_ is set, it is cancelled and rescheduled. + + int set_deadline_timeout (ACE_ES_Consumer_Rep_Timeout *cr); + // Set the group's reference to the deadline timer. Returns 0 on + // success, -1 on failure. + + typedef ACE_CORBA_Sequence<ACE_ES_Event_Container_var> Event_Set; + + virtual void add_events (Event_Set *outbox, + Event_Set *pending_events, + u_long &pending_flags); + // Does nothing. This is the only virtual method in this little + // heirarchy with the conjunction group. + + void set_act (RtecEventComm::Event &act); + // Set the ACT for this group. + +protected: + ACE_ES_Event_Container_var act_; + // To be sent with this group. + +private: + ACE_ES_Consumer_Rep_Timeout *deadline_timer_rep_; + // The disjunction group keeps a reference to the deadline timer. + + ACE_ES_Correlation_Module *correlation_module_; + // Used for cancelling and scheduling deadline_timer_rep_. +}; + +// ************************************************************ + +class ACE_ES_Conjunction_Group : public ACE_ES_Disjunction_Group +// = TITLE +// Conjunction Group +// +// = DESCRIPTION +// Represents a conjunction group, such as (A+B+C). +{ +public: + ACE_ES_Conjunction_Group (void); + // Default construction. + + int add_type (int type_id); + // Set the <type_id>th bit in the forward_value_. + + int should_forward (u_long pending_flags); + // Returns 1 if this conjunction group's dependencies have been + // satisfied. Returns 0 otherwise. + + typedef ACE_CORBA_Sequence<ACE_ES_Event_Container_var> Event_Set; + + virtual void add_events (Event_Set *outbox, + Event_Set *pending_events, + u_long &pending_flags); + // For each bit set in forward_value_, the corresponding events in + // <pending_events> is added to <outbox>. Each bit set in + // <forward_value_> is cleared in <pending_flags>. If <oubox> == 0, + // then add_events just clears the pending events and flags. + +private: + u_long forward_value_; +}; + +// ************************************************************ + +// Forward decl. +class ACE_ES_Consumer_Correlation; + +class ACE_ES_Consumer_Rep : public ACE_ES_Timer_ACT +// = TITLE +// Consumer Representation. +// +// = DESCRIPTION +// These are stored in the subscription module. They store +// information that allows optimized correlations. It represents +// the consumer that will handle *one* type of event. This +// probably shouldn't inherit from ACE_ES_Timer_ACT since it's used +// only by ACE_ES_Consumer_Rep_Timeout. However, this allows me to +// minimize dynamic allocation. +{ +public: + ACE_ES_Consumer_Rep (void); + // Default construction. + + void init (ACE_ES_Consumer_Correlation *correlation, + RtecEventChannelAdmin::Dependency &dep); + // <dep> describes the event subscribed to and the method handling + // the event. <correlation> is the parent correlation object. + + virtual ~ACE_ES_Consumer_Rep (void); + // Virtual destruction. + + RtecEventChannelAdmin::Dependency *dependency (void); + // The event subscribed to and the method that will handle this + // event. + + int type_id (void); + // Get the correlation group index of this consumer rep's event + // type. + + void type_id (int); + // Set the correlation group index of this consumer rep's event + // type. + + enum Correlation_Type + { + NO_CORRELATION, + CORRELATE, + DEADLINE_TIMEOUT, + GLOBAL_DEADLINE + }; + + u_long correlation_type (void); + // If this returns 0, then the event associated with this consumer + // should be forwarded without running any correlations. + + void correlation_type (u_long ct); + // Set whether the event should be correlated. <ct> is a + // Correlation_Type. + + int add_disjunction_group (ACE_ES_Disjunction_Group &); + // Add a disjunction group. + + ACE_ES_Disjunction_Group *top_group (void); + // Returns the first disjunction group added via + // this->add_disjunction_group. + + void reschedule_deadlines (void); + // Calls reschedule_deadline on all disjunction groups added through + // this->add_disjunction_group. + + int receiving_events (void); + // Returns 1 if events should be sent to this consumer. Returns 0 + // if they should not (suspended or disconnected). + + void suspend (void); + // Stop forwarding events to the calling consumer. + + void resume (void); + // Resume forwarding events to the calling consumer. + + ACE_ES_Consumer_Correlation *correlation (void); + // Returns the Consumer_Correlation object for the target consumer. + + void disconnect (void); + // Schedules the consumer rep to be removed from all subscription + // lists. + + int disconnected (void); + // Returns 1 if the consumer rep should be removed from all + // subscription lists. + + void _duplicate (void); + // Increments ref_count_. + + void _release (void); + // Decrements ref_count_ and deletes this if 0. + +protected: + int disconnected_; + // Whether the rep should be removed from all subscription lists. + + virtual void execute (void); + // This is called when timeouts occur. This implementation prints + // out an error message (since it really shouldn't be implemented in + // this class). + + int suspended_; + // Whether events should be dropped or forwarded. + + u_long correlation_type_; + // Whether any correlating should be done for this event. + + RtecEventChannelAdmin::Dependency *dependency_; + // Event subscribed to. + + ACE_ES_Consumer_Correlation *correlation_; + // The target consumer of events. + + int type_id_; + // Correlation group index of event_->type_. + + ACE_ES_Disjunction_Group *disjunction_group_; + // This should be a set. We'll just have room for one now. + + ACE_Atomic_Op<ACE_ES_MUTEX, int> ref_count_; + // Lock for reference count. +}; + +class ACE_ES_Consumer_Rep_Timeout : public ACE_ES_Consumer_Rep +// = TITLE +// Consumer Representation. +// +// = DESCRIPTION +// These are stored in the subscription module. They store +// information that allows optimized correlations. It represents +// the consumer that will handle *one* type of event. +{ +public: + ACE_ES_Consumer_Rep_Timeout (void); + // Default construction. + + void init (ACE_ES_Consumer_Correlation *correlation, + RtecEventChannelAdmin::Dependency &dep); + // <dep> describes the event subscribed to and the method handling + // the event. <correlation> is the parent correlation object. + + // = Get/set timer returned from the reactor. + int timer_id (void); + void timer_id (int); + + // = Get/set preemption priority. + RtecScheduler::OS_Priority preemption_priority (void); + void preemption_priority (RtecScheduler::OS_Priority pp); + +protected: + virtual void execute (void); + // This is called when timeouts occur. Calls correlation_-> + + int timer_id_; + // For cancelling timers. + + RtecScheduler::OS_Priority preemption_priority_; + // Store the preemption priority so we can cancel the correct timer. + // The priority values may change during the life. + + ACE_ES_Event_Container_var timeout_event_; +}; + +// ************************************************************ + +class ACE_ES_Subscription_Info +// = TITLE +// Event Service Subscription Info +// +// = DESCRIPTION +// Contains information on all consumers subscribed to a supplier. +// Each Push_Supplier_Proxy has an instance of this class. This +// should really be defined in Channel_Modules.h, but I want to +// have an instance of it in each ACE_Push_Supplier_Proxy. This +// allows us to reduce the amount of dynamic memory allocation. +{ +public: + ~ACE_ES_Subscription_Info (void); + // Free up dynamic resources. + + typedef ACE_Unbounded_Set_Iterator<ACE_ES_Consumer_Rep *> Subscriber_Set_Iterator; + typedef ACE_Unbounded_Set<ACE_ES_Consumer_Rep *> Subscriber_Set; + + class Type_Subscribers + // = DESCRIPTION + // There is one of these for each event type generated by the + // supplier. It contains the subscribers and the + // dependency_info_ describing the method that generates this + // event type. + { + public: + Type_Subscribers (RtecScheduler::Dependency_Info *d) + : dependency_info_ (d) {} + // Construction requires a dependency info describing the method + // that generates events for the consumers_. We use a pointer so + // that a null can be passed in this->insert_or_allocate. + + // void operator= (const Subscriber_Set &); + // Copy. + + Subscriber_Set consumers_; + // All the consumers that have registered for this event. + + RtecScheduler::Dependency_Info *dependency_info_; + // Description of the method that generates this event. + }; + + typedef RtecEventComm::EventType EXT; + typedef Type_Subscribers *INT; + typedef ACE_Null_Mutex SYNCH; + typedef ACE_Map_Manager<EXT, INT, SYNCH> Subscriber_Map; + typedef ACE_Map_Iterator<EXT, INT, SYNCH> Subscriber_Map_Iterator; + typedef ACE_Map_Entry<EXT, INT> Subscriber_Map_Entry; + + Subscriber_Set source_subscribers_; + // Source-based subscribers. + + Subscriber_Map type_subscribers_; + // Type-based subscribers. + + // = These are just typedefs for source-based subscriptions. + typedef RtecEventComm::EventSourceID sEXT; + typedef Subscriber_Set *sINT; + typedef ACE_Map_Manager<sEXT, sINT, SYNCH> SourceID_Map; + typedef ACE_Map_Iterator<sEXT, sINT, SYNCH> SourceID_Map_Iterator; + typedef ACE_Map_Entry<sEXT, sINT> SourceID_Map_Entry; + + ACE_ES_RW_LOCK lock_; + // Serializes writes to source_subscribers_ and type_subscribers_. + + static int insert_or_allocate (SourceID_Map &source_subscribers, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID sid); + // <source_subscribers> contains a mapping of source id to consumer + // list. Insert <consumer> into the list of consumers subscribed to + // <sid>. Allocate a list for <sid> if necessary. + + static int insert_or_allocate (Subscriber_Map &type_subscribers, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type); + // Add <consumer> to the set of consumers bound to <type> in + // <type_subscribers>. If there is consumer set for <type>, one is + // allocated. Returns -1 on failure, 0 otherwise. + + static int insert_or_fail (Subscriber_Map &type_subscribers, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type, + RtecScheduler::Dependency_Info *&dependency); + // Add <consumer> to the set of consumers bound to <type> in + // <type_subscribers>. If there is consumer set for <type>, the + // operation fails. Returns -1 on failure, 0 otherwise. + + static int remove (Subscriber_Map &type_map, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type); + // Remove <consumer> from the consumer set in <type_map> set + // corresponding to <type>. + + static int remove (SourceID_Map &source_subscribers, + ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID sid); + // Remove <consumer> from the consumer set in the + // <source_subscribers> set corresponding to <sid>. + + static void append_subscribers (Subscriber_Set &dest, + Subscriber_Set &src); + // Insert all elements of <src> into <dest>. +}; + +// ************************************************************ + +// Forward declarations. +class ACE_ES_Dispatch_Request; +class ACE_Push_Consumer_Proxy; + +class ACE_ES_Consumer_Correlation : public RtecEventComm_PushSupplierBOAImpl +// = TITLE +// Event Service Consumer_Correlation +// +// = DESCRIPTION +// There is one Consumer Correlation object per call to +// connect_push_consumer. It handles all the consumer's +// correlation dependencies including timeouts. This is also a +// PushSupplier to support event forwarding. +{ +public: + ACE_ES_Consumer_Correlation (void); + // Default construction. + + virtual ~ACE_ES_Consumer_Correlation (void); + // Deletes lock_. + + int connected (ACE_Push_Consumer_Proxy *consumer, + ACE_ES_Correlation_Module *correlation_module); + // Initialization. <correlation_module> is stored for delegating + // channel operations. <consumer> is stored to access the consumers + // qos and filterin data. Returns 0 on success, -1 on failure. + + int disconnecting (void); + // Shutdown. + + ACE_ES_Dispatch_Request *push (ACE_ES_Consumer_Rep *consumer, + ACE_ES_Event_Container *event); + // Takes <event> and adds it to the correlation. Returns the + // dispatch request that should be forwarded. + + void suspend (void); + // Stop forwarding events to the calling consumer. + + void resume (void); + // Resume forwarding events to the calling consumer. + + ACE_ES_Correlation_Module *correlation_module_; + // Pointer back to the main correlation module. This is public so + // that ACE_ES_Consumer_Rep_Timeout::execute can access it. + + typedef ACE_CORBA_Sequence<ACE_ES_Event_Container_var> Event_Set; + +private: + virtual void disconnect_push_supplier (CORBA::Environment &); + // Called when the channel disconnects us. + + int allocate_correlation_resources (ACE_ES_Dependency_Iterator &iter); + // Dynamically allocates structures needed for correlations. 0 on + // success, -1 on failure. + + ACE_ES_Dispatch_Request * correlate (ACE_ES_Consumer_Rep *cr, + ACE_ES_Event_Container *event); + // Helper function for this->push. + + // = Registration helper functions. + int register_deadline_timeout (RtecEventChannelAdmin::Dependency &dependency, + RtecEventComm::EventType group_type, + int cgindex, + int dgindex, + int &trep_index); + int register_interval_timeout (RtecEventChannelAdmin::Dependency &dependency, + RtecEventComm::EventType group_type, + int cgindex, + int dgindex, + int &trep_index); + int register_event (RtecEventChannelAdmin::Dependency &dependency, + RtecEventComm::EventType group_type, + int cgindex, + int dgindex, + int &crep_index); + + ACE_ES_Consumer_Rep *get_consumer_rep (RtecEventChannelAdmin::Dependency &dependency, + int &crep_index); + int new_type_id (void); + + int type_id_index_; + + RtecEventChannelAdmin::ProxyPushConsumer_ptr channel_; + // For event forwarding. + + RtecEventChannelAdmin::SupplierQOS qos_; + // Supplier QOS specifications. + + // Events waiting to be forwarded. + Event_Set *pending_events_; + + // Used to synchronize pending_events_ and by the correlation module. + ACE_ES_MUTEX lock_; + // Used to lock shared state. + + ACE_Push_Consumer_Proxy *consumer_; + + u_long pending_flags_; + // A bit is set for each dependency satisfied. + + ACE_ES_Consumer_Rep **consumer_reps_; + // Array of consumer rep pointers. + int n_consumer_reps_; + ACE_ES_Consumer_Rep_Timeout *timer_reps_; + int n_timer_reps_; + + ACE_ES_Conjunction_Group *conjunction_groups_; + int n_conjunction_groups_; + ACE_ES_Disjunction_Group *disjunction_groups_; + int n_disjunction_groups_; + + int connected_; + // True when we're connected to the channel for forwarding. +}; + +// ************************************************************ + +class ACE_ES_ACT +// = TITLE +// Event Service ACT +// +// = DESCRIPTION +// +{ +public: + ACE_ES_ACT (void); + int has_act_; + RtecEventComm::Event act_; +}; + +// ************************************************************ + +// Forward declarations. +class ACE_ES_Dispatch_Request; + +class ACE_ES_Consumer_Module : public RtecEventChannelAdmin_ConsumerAdminBOAImpl +// = TITLE +// Event Service Consumer Module +// +// = DESCRIPTION +// ProxyPushSupplier factory. +{ +public: + ACE_ES_Consumer_Module (ACE_EventChannel *channel); + // Default construction. + + void open (ACE_ES_Dispatching_Module *down); + // Link to the next module. + + virtual RtecEventChannelAdmin::ProxyPushSupplier_ptr obtain_push_supplier (CORBA::Environment &); + // Factory method for push consumer proxies. + + void connected (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &); + // Register the consumer with the Event Service. This handles all + // the details regarding Correlation_Module and Subscription_Module. + + void disconnecting (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &); + // Unregister the consumer from the Event Service. + + void push (const ACE_ES_Dispatch_Request *request, + CORBA::Environment &); + + RtecEventChannelAdmin::ConsumerAdmin_ptr get_ref (void); + // Allow transformations to RtecEventChannelAdmin::ConsumerAdmin. + + void shutdown_request (ACE_ES_Dispatch_Request *request); + // This is called by Shutdown_Consumer command objects when a + // consumer proxy is ready to be deleted. + + void shutdown (void); + // Actively disconnect from all consumers. + +private: + typedef ACE_Unbounded_Set_Iterator<ACE_Push_Consumer_Proxy *> Consumer_Iterator; + typedef ACE_Unbounded_Set<ACE_Push_Consumer_Proxy *> Consumers; + + ACE_ES_MUTEX lock_; + // Protects access to all_consumers_. + + Consumers all_consumers_; + + ACE_EventChannel *channel_; + // Used to test for shutdown. + + RtecEventChannelAdmin::ConsumerAdmin_ptr me_; + + ACE_ES_Dispatching_Module *down_; + // Next module down. +}; + +// ************************************************************ + +// Forward declaration. +class ACE_ES_Subscription_Module; + +class ACE_ES_Correlation_Module +// = TITLE +// Event Service Correlation Module +// +// = DESCRIPTION +// +{ +public: + ACE_ES_Correlation_Module (ACE_EventChannel *channel); + // Default construction. + + void open (ACE_ES_Dispatching_Module *up, + ACE_ES_Subscription_Module *down); + // Link to adjacent modules. + + void connected (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &); + // Create the consumers filter object. + + void disconnecting (ACE_Push_Consumer_Proxy *consumer, + CORBA::Environment &); + // Release the consumers filter object. + + void push (ACE_ES_Consumer_Rep *consumer, + ACE_ES_Event_Container *event, + CORBA::Environment &); + // Take in an event and its subscriber. Apply consumer-specific + // filters to each event and forward any dispatch requests to the + // Dispatching Module. + + // = These are called by ACE_ES_Consumer_Reps. + + int subscribe (ACE_ES_Consumer_Rep *consumer); + // Forwards to the subscription module. + + //int unsubscribe (ACE_ES_Consumer_Rep *consumer); + // Forwards to the subscription module. + + int schedule_timeout (ACE_ES_Consumer_Rep_Timeout *consumer); + // Schedule consumer timeout. Return 0 on success, -1 on failure. + + int cancel_timeout (ACE_ES_Consumer_Rep_Timeout *consumer); + // Cancel consumer timeout. Return 0 on success, -1 on failure. + + int reschedule_timeout (ACE_ES_Consumer_Rep_Timeout *consumer); + // Reschedule consumer timeout. Return 0 on success, -1 on failure. + + ACE_EventChannel *channel_; + // The master channel. This is public so that Consumer_Correlation + // objects can access it. + + void shutdown (void); + // Does nothing. + +private: + ACE_ES_Dispatching_Module *up_; + // Next module up. + + ACE_ES_Subscription_Module *subscription_module_; + // Next module down. +}; + +// ************************************************************ + +// Forward declaration. +class ACE_ES_Supplier_Module; +class ACE_Push_Supplier_Proxy; + +class ACE_ES_Subscription_Module +// = TITLE +// Event Service Subscription Module +// +// = DESCRIPTION +// +// = SYNCHRONIZATION +// This is currently implemented with very coarse-grain +// synchronization. Basically, there is a single readers/writer +// lock. All operations acquire the writer lock to change any +// subscription record. All operations acquire a reader lock to +// read any subscription record. This is fine for normal +// operations (which are *all* read operations). However, the +// initialization and shutdown periods might benefit from the +// potential increase in concurrency if we used finer grain locks +// (e.g., lock-per-source). +{ +public: + ACE_ES_Subscription_Module (ACE_EventChannel *channel); + // Default construction. + + void open (ACE_ES_Correlation_Module *up, + ACE_ES_Supplier_Module *down); + // Link to the adjacent modules. + + ~ACE_ES_Subscription_Module (void); + // Deletes the lock_. + + int subscribe (ACE_ES_Consumer_Rep *consumer); + // Register a new consumer. Calls into <consumer> to figure out the + // subscription options. Returns 0 on success, -1 on failure. + + int unsubscribe (ACE_ES_Consumer_Rep *consumer); + // Removes the -consumer- from any subscription lists. + + void connected (ACE_Push_Supplier_Proxy *supplier, + CORBA::Environment &); + void disconnecting (ACE_Push_Supplier_Proxy *supplier, + CORBA::Environment &); + + void push (ACE_Push_Supplier_Proxy *source, + ACE_ES_Event_Container *event, + CORBA::Environment &); + // Takes in a set of events and pushes subscriber sets to the + // Correlation Module. + + // void push (ACE_Push_Supplier_Proxy *source, + // const RtecEventComm::Event event); + // This doesn't need one of these since it will never be called. + + void shutdown (void); + // Unsubscribes all consumers from the suppliers. + +private: + void reregister_consumers (RtecEventComm::EventSourceID source_id); + // Reregister any consumers that registered for <source_id> before + // it actually connected to the channel. + + ACE_EventChannel *channel_; + // The channel of all channels. + + /* + typedef ACE_ES_Subscription_Info::Subscriber_Set INT; + typedef ACE_Null_Mutex SYNCH; + typedef ACE_Map_Manager<EXT, INT, SYNCH> Source_Collection; + typedef ACE_Map_Iterator<EXT, INT, SYNCH> Source_Collection_Iterator; + typedef ACE_Map_Entry<EXT, INT> Source_Collection_Entry; + Source_Collection source_subscription_info_; + // Source-only subscribers. + */ + + // = Subscribe helper methods. Returns 0 on success, -1 on failure. + + int subscribe_all (ACE_ES_Consumer_Rep *consumer); + + int subscribe_type (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type); + + int subscribe_source (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID source); + + int subscribe_source_type (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID source, + RtecEventComm::EventType type); + + int unsubscribe_all (ACE_ES_Consumer_Rep *consumer); + + int unsubscribe_type (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventType type); + + int unsubscribe_source (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID source); + + int unsubscribe_source_type (ACE_ES_Consumer_Rep *consumer, + RtecEventComm::EventSourceID source, + RtecEventComm::EventType type); + + // = Push helper methods. + + int push_source (ACE_Push_Supplier_Proxy *source, + ACE_ES_Event_Container *event); + // Push <event> to all consumers subscribed to all events from + // <source>. Returns 0 on success, -1 on failure. + + int push_source_type (ACE_Push_Supplier_Proxy *source, + ACE_ES_Event_Container *event); + // Push <event> to all consumers subscribed to <event>.type_ from + // <source>. Returns 0 on success, -1 on failure. + + void push_all (ACE_ES_Event_Container *event, + CORBA::Environment &); + // Push <event> to all_suppliers_. + + ACE_ES_Correlation_Module *up_; + // Next module up stream. + + ACE_ES_Supplier_Module *down_; + // Next module down stream. + + typedef ACE_Unbounded_Set_Iterator<ACE_Push_Supplier_Proxy *> Supplier_Iterator; + typedef ACE_Unbounded_Set<ACE_Push_Supplier_Proxy *> Suppliers; + + Suppliers all_suppliers_; + // All suppliers. + + ACE_ES_Subscription_Info::Subscriber_Map type_subscribers_; + // Type-based subscribers. + + ACE_ES_Subscription_Info::SourceID_Map source_subscribers_; + // Source-based subscribers. + + ACE_ES_RW_LOCK lock_; + // Protects access to all_suppliers_ and type_suppliers_; +}; + +// ************************************************************ + +class ACE_ES_Supplier_Module : public RtecEventChannelAdmin_SupplierAdminBOAImpl +// = TITLE +// Event Service Supplier Proxy Module +// +// = DESCRIPTION +// ProxyPushConsumer factory. +{ +public: + ACE_ES_Supplier_Module (ACE_EventChannel *channel); + // Default construction. + + void open (ACE_ES_Subscription_Module *up); + // Associate the module to a channel. + + virtual RtecEventChannelAdmin::ProxyPushConsumer_ptr obtain_push_consumer (CORBA::Environment &); + // Factory method for push supplier proxies. + + void push (ACE_Push_Supplier_Proxy *proxy, + const RtecEventComm::EventSet &event, + CORBA::Environment &); + // The supplier module acts on behalf of the supplier proxy to + // forward events through the channel. + + void connected (ACE_Push_Supplier_Proxy *supplier, + CORBA::Environment &); + // Register the consumer with the Event Service. This handles all + // the details regarding Correlation_Module and Subscription_Module. + + void disconnecting (ACE_Push_Supplier_Proxy *supplier, + CORBA::Environment &); + // Unregister the consumer from the Event Service. + + RtecEventChannelAdmin::SupplierAdmin_ptr get_ref (void); + // Allow transformations to RtecEventComm::PushConsumer. + + void shutdown (void); + // Actively disconnect from all suppliers. + +private: + typedef ACE_Unbounded_Set_Iterator<ACE_Push_Supplier_Proxy *> Supplier_Iterator; + typedef ACE_Unbounded_Set<ACE_Push_Supplier_Proxy *> Suppliers; + + Suppliers all_suppliers_; + // All suppliers. + + ACE_ES_MUTEX lock_; + // Protects access to all_suppliers_ and type_suppliers_; + + RtecEventChannelAdmin::SupplierAdmin_ptr me_; + + ACE_ES_Subscription_Module *up_; + + ACE_EventChannel *channel_; + // Used to test for shutdown. +}; + +// ************************************************************ + +// Forward declarations. +class ACE_EventChannel; + +// = Event Channel interfaces. + +class ACE_Push_Supplier_Proxy : public RtecEventChannelAdmin_ProxyPushConsumerBOAImpl +// = TITLE +// Push Supplier Proxy. +// +// = DESCRIPTION +// To the channel, this is a proxy to suppliers. To suppliers, it +// exports a PushConsumer interface. It is a +// RtecEventChannelAdmin::ProxyPushConsumer. Suppliers use this +// interface to connect to the channel, push events to consumers, +// and to disconnect from the channel. +{ +public: + ACE_Push_Supplier_Proxy (ACE_ES_Supplier_Module *supplier_module); + // Must be created with an owning supplier admin. + + // = Operations public to suppliers. + + virtual void connect_push_supplier (RtecEventComm::PushSupplier_ptr push_supplier, + const RtecEventChannelAdmin::SupplierQOS& qos, + CORBA::Environment &); + // Suppliers connect via this interface. <push_supplier> is a + // reference to the supplier. <qos> represents the publish types of + // the supplier. + + virtual void push (const RtecEventComm::EventSet &event, + CORBA::Environment &); + // Data arriving from a PushSupplier that must be sent to + // consumers. This is the entry point of all events. + + virtual void disconnect_push_consumer (CORBA::Environment &); + // Disconnect the supplier from the channel. + + // = Operations for the Event Channel. + + RtecEventChannelAdmin::ProxyPushConsumer_ptr get_ref (void); + // Allow transformations to RtecEventChannelAdmin::ProxyPushConsumer. + + int connected (void); + // Returns 1 if the proxy has been connected to a "remote" client. + + void shutdown (void); + // Actively disconnect from the supplier. + + // This is a hook so that the Subscription Module can associate + // state with supplier proxies. + ACE_ES_Subscription_Info &subscription_info (void); + + RtecEventChannelAdmin::SupplierQOS &qos (void); + // Filtering criteria. + + int operator== (const RtecEventComm::EventSourceID rhs); + // Is this object a proxy for -rhs-. Simple pointer comparison for now. + + RtecEventComm::EventSourceID source_id (void); + // Returns underlying supplier object ref. + +private: + RtecEventChannelAdmin::SupplierQOS qos_; + // Reference to the supplier's qos params. + + ACE_ES_Subscription_Info subscription_info_; + + ACE_ES_Supplier_Module *supplier_module_; + + RtecEventComm::EventSourceID source_id_; + // We keep a proxy of the Supplier source_id_; + + RtecEventChannelAdmin::ProxyPushConsumer_ptr me_; + // CORBA reference to self. + + RtecEventComm::PushSupplier_ptr push_supplier_; + // CORBA reference to remote push supplier. +}; + +// ************************************************************ + +class ACE_Push_Consumer_Proxy : public RtecEventChannelAdmin_ProxyPushSupplierBOAImpl +// = TITLE +// Push Consumer Proxy. +// +// = DESCRIPTION +// This is the channels proxy to a push consumer. It implements +// the RtecEventChannelAdmin::ProxyPushSupplier IDL interface. +// Consumers use this interface to connect and disconnect from the +// channel. +{ +public: + ACE_Push_Consumer_Proxy (ACE_ES_Consumer_Module *cm); + // Must be created with an consumer admin. + + virtual ~ACE_Push_Consumer_Proxy (void); + // Default destruction + + // = Interfaces exported to consumers. + + virtual void connect_push_consumer (RtecEventComm::PushConsumer_ptr push_consumer, + const RtecEventChannelAdmin::ConsumerQOS& qos, + CORBA::Environment &); + // A push consumer is connecting. <push_consumer> is a reference to + // the consumer. <qos> is the subscription types for the consumer. + + virtual void disconnect_push_supplier (CORBA::Environment &); + // The consumer is disconnecting. + + virtual void suspend (CORBA::Environment &); + // Stop forwarding events to the calling consumer. + + virtual void resume (CORBA::Environment &); + // Resume forwarding events to the calling consumer. + + // = Event Channel operations. + + void push (const RtecEventComm::EventSet &events, + CORBA::Environment &); + // Push <events> to push_consumer_. + + int connected (void); + // Returns 1 if the proxy has been connected to a "remote" client. + + void shutdown (void); + // Actively disconnect from the consumer. + + RtecEventChannelAdmin::ProxyPushSupplier_ptr get_ref (void); + // Allow transformations to RtecEventChannelAdmin::ProxyPushSupplier. + + ACE_ES_Consumer_Correlation &correlation (void); + // Access the consumer-specific Consumer_Correlation. + + RtecEventChannelAdmin::ConsumerQOS &qos (void); + // Filtering criteria. + +private: + RtecEventChannelAdmin::ConsumerQOS qos_; + // A reference to the consumers Quality of Service parameters. + + ACE_ES_Consumer_Correlation correlation_; + // A hook so that the Correlation Module can associate correlation + // information with the consumer. + + RtecEventChannelAdmin::ProxyPushSupplier_ptr me_; + // CORBA reference to self. + + RtecEventComm::PushConsumer_ptr push_consumer_; + // Reference to our push consumer. + + ACE_ES_Consumer_Module *consumer_module_; + // TODO: Maybe this should be a _var or _duplicate/_release should + // be used +}; + +// ************************************************************ + +// Helper function that returns +// qos.dependencies_[0].rt_info_->entry_point or "no-name". +const char * +ACE_ES_Consumer_Name (const RtecEventChannelAdmin::ConsumerQOS &qos); + +// ************************************************************ + +typedef ACE_ES_Simple_Array <ACE_ES_Consumer_Rep *, + ACE_ES_MAX_CONSUMERS_PER_SUPPLIER> ACE_ES_CRSet; + +typedef ACE_ES_Array_Iterator <ACE_ES_Consumer_Rep *> ACE_ES_CRSet_Iterator; + +#if defined (__ACE_INLINE__) +#include "Event_Channel.i" +#endif /* __ACE_INLINE__ */ +#endif /* ACE_EVENT_CHANNEL_H */ + diff --git a/TAO/orbsvcs/Event_Service/Event_Channel.i b/TAO/orbsvcs/Event_Service/Event_Channel.i new file mode 100644 index 00000000000..304a8e321d9 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Event_Channel.i @@ -0,0 +1,890 @@ +/* -*- C++ -*- */ +// $Id$ + +const unsigned int ACE_INT2BIT[32] = +{ + 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, + 16384, 32768, 65536, 131072, 262144, 524288, 1048576, 2097152, + 4194304, 8388608, 16777216, 33554432, 67108864, 134217728, + 268435456, 536870912, 1073741824, 2147483648, +}; + +// ************************************************** + +ACE_INLINE RtecEventChannelAdmin::ProxyPushConsumer_ptr +ACE_Push_Supplier_Proxy::get_ref (void) +{ + return RtecEventChannelAdmin::ProxyPushConsumer::_duplicate(me_); +} + +ACE_INLINE int +ACE_Push_Supplier_Proxy::connected (void) +{ + return !CORBA::is_nil((CORBA::Object*) push_supplier_); +} + +ACE_INLINE ACE_ES_Subscription_Info & +ACE_Push_Supplier_Proxy::subscription_info (void) +{ + return subscription_info_; +} + +ACE_INLINE RtecEventChannelAdmin::SupplierQOS & +ACE_Push_Supplier_Proxy::qos (void) +{ + return qos_; +} + +ACE_INLINE int +ACE_Push_Supplier_Proxy::operator== (const RtecEventComm::EventSourceID rhs) +{ + // Pointer comparison is fine for now. + return (source_id_ == rhs); +} + +ACE_INLINE RtecEventComm::EventSourceID +ACE_Push_Supplier_Proxy::source_id (void) +{ + return source_id_; +} + +// ************************************************** + +ACE_INLINE RtecEventChannelAdmin::ProxyPushSupplier_ptr +ACE_Push_Consumer_Proxy::get_ref (void) +{ + return RtecEventChannelAdmin::ProxyPushSupplier::_duplicate(me_); +} + +ACE_INLINE RtecEventChannelAdmin::ConsumerQOS & +ACE_Push_Consumer_Proxy::qos (void) +{ + return qos_; +} + +ACE_INLINE int +ACE_Push_Consumer_Proxy::connected (void) +{ + return !CORBA::is_nil(push_consumer_); +} + +ACE_INLINE void +ACE_Push_Consumer_Proxy::push (const RtecEventComm::EventSet &events, + CORBA::Environment &_env) +{ + ACE_TIMEPROBE (" deliver event to consumer proxy"); + + if (push_consumer_ == 0) + { + ACE_DEBUG ((LM_DEBUG, "Push to disconnected consumer %s: ", + ::ACE_ES_Consumer_Name (this->qos ()))); + // ACE_ES_DEBUG_ST (::dump_sequence (events)); + return; + } + + ACE_TRY + { + push_consumer_->push (events, ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCH (RtecEventComm::Disconnected, d) + { + ACE_ERROR ((LM_ERROR, "consumer disconnected.\n")); + ACE_RETHROW; + } + ACE_CATCH (CORBA::SystemException, se) + { + ACE_ERROR ((LM_ERROR, "system exception.\n")); + ACE_RETHROW; + } + ACE_ENDTRY; +} + +ACE_INLINE ACE_ES_Consumer_Correlation & +ACE_Push_Consumer_Proxy::correlation (void) +{ + return correlation_; +} + +ACE_INLINE RtecEventChannelAdmin::ConsumerAdmin_ptr +ACE_ES_Consumer_Module::get_ref (void) +{ + return RtecEventChannelAdmin::ConsumerAdmin::_duplicate(me_); +} + +ACE_INLINE RtecEventChannelAdmin::SupplierAdmin_ptr +ACE_ES_Supplier_Module::get_ref (void) +{ + return RtecEventChannelAdmin::SupplierAdmin::_duplicate(me_); +} + +// ************************************************** + +ACE_INLINE RtecEventChannelAdmin::EventChannel_ptr +ACE_EventChannel::get_ref (void) +{ + return RtecEventChannelAdmin::EventChannel::_duplicate(me_); +} + +ACE_INLINE RtecEventChannelAdmin::SupplierAdmin_ptr +ACE_EventChannel::for_suppliers (CORBA::Environment &) +{ + return supplier_module_->get_ref (); +} + +ACE_INLINE RtecEventChannelAdmin::ConsumerAdmin_ptr +ACE_EventChannel::for_consumers (CORBA::Environment &) +{ + return consumer_module_->get_ref (); +} + +ACE_INLINE ACE_ES_Priority_Timer * +ACE_EventChannel::timer (void) +{ + return timer_; +} + +// ************************************************************ + +// Makes a temporary Event_var and appends it to the <dest>. +ACE_INLINE void +operator += (ACE_CORBA_Sequence<ACE_ES_Event_Container_var> &dest, + ACE_ES_Event_Container *item) +{ + int length = dest.length (); + dest.length (length + 1); + dest[length] = item; +} + +/* +// Makes a temporary Event_var and appends it to the <dest>. +ACE_INLINE void +operator += (ACE_CORBA_Sequence<RtecEventComm::Event_var> &dest, + RtecEventComm::Event *item) +{ + // RtecEventComm::Event_var event (item); + int length = dest.length (); + dest.length (length + 1); + dest[length] = item; +} +*/ + +ACE_INLINE int +operator == (const RtecEventComm::Event &event1, + const RtecEventComm::Event &event2) +{ + // Check if the sources are equal. 0 is a wildcard. + if ((event1.source_ != 0) && (event2.source_ != 0) + && (event1.source_ != event2.source_)) + return 0; + + // Check if the types are equal. ACE_ES_EVENT_ANY is a wildcard. + if ((event1.type_ != ACE_ES_EVENT_ANY) && + (event2.type_ != ACE_ES_EVENT_ANY) && + (event1.type_ != event2.type_)) + return 0; + + return 1; +} + +// ************************************************************ + +ACE_INLINE +ACE_ES_ACT::ACE_ES_ACT (void) + : has_act_ (0) +{ +} + +// ************************************************************ + +ACE_INLINE +ACE_ES_Disjunction_Group::ACE_ES_Disjunction_Group (void) : + act_ (), + deadline_timer_rep_ (0), + correlation_module_ (0) +{ +} + +ACE_INLINE void +ACE_ES_Disjunction_Group::set_correlation_module (ACE_ES_Correlation_Module *cm) +{ + correlation_module_ = cm; +} + +ACE_INLINE void +ACE_ES_Disjunction_Group::reschedule_deadline (void) +{ + if (deadline_timer_rep_ != 0) + { + if (correlation_module_->reschedule_timeout (deadline_timer_rep_) == -1) + ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_ES_Disjunction_Group::reschedule_deadline")); + } +} + +ACE_INLINE int +ACE_ES_Disjunction_Group::set_deadline_timeout (ACE_ES_Consumer_Rep_Timeout *cr) +{ + deadline_timer_rep_ = cr; + // Schedule the timeout. + if (correlation_module_->schedule_timeout (deadline_timer_rep_) == -1) + return -1; + else + return 0; +} + +ACE_INLINE void +ACE_ES_Disjunction_Group::add_events (Event_Set *outbox, + Event_Set *pending_events, + u_long &pending_flags) +{ + ACE_UNUSED_ARG (pending_events); + ACE_UNUSED_ARG (pending_flags); + + // Append the act. + if (act_ != 0) + *outbox += act_; +} + +ACE_INLINE void +ACE_ES_Disjunction_Group::set_act (RtecEventComm::Event &act) +{ + ACE_ES_Event_Container *temp = new ACE_ES_Event_Container (act); + if (temp == 0) + { + ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_ES_Disjunction_Group::set_act")); + return; + } + + act_ = temp; + temp->_release (); +} + +// ************************************************************ + +ACE_INLINE +ACE_ES_Consumer_Rep::ACE_ES_Consumer_Rep (void) : + disconnected_ (0), + suspended_ (0), + correlation_type_ (ACE_ES_Consumer_Rep::NO_CORRELATION), + dependency_ (0), + correlation_ (0), + type_id_ (0), + disjunction_group_ (0), + ref_count_ (1) +{ +} + +ACE_INLINE void +ACE_ES_Consumer_Rep::init (ACE_ES_Consumer_Correlation *correlation, + RtecEventChannelAdmin::Dependency& dependency) +{ + dependency_ = &dependency; + correlation_ = correlation; +} + +ACE_INLINE RtecEventChannelAdmin::Dependency* +ACE_ES_Consumer_Rep::dependency (void) +{ + return dependency_; +} + +ACE_INLINE int +ACE_ES_Consumer_Rep::type_id (void) +{ + return type_id_; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep::type_id (int id) +{ + type_id_ = id; +} + +ACE_INLINE ACE_ES_Consumer_Correlation * +ACE_ES_Consumer_Rep::correlation (void) +{ + return correlation_; +} + +ACE_INLINE u_long +ACE_ES_Consumer_Rep::correlation_type (void) +{ + return correlation_type_; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep::correlation_type (u_long ct) +{ + correlation_type_ = ct; +} + +ACE_INLINE int +ACE_ES_Consumer_Rep::add_disjunction_group (ACE_ES_Disjunction_Group &dg) +{ + if (disjunction_group_ != 0) + ACE_ERROR ((LM_ERROR, "ACE_ES_Consumer_Rep::add_disjunction_group: " + "disjunction_group already set!\n")); + disjunction_group_ = &dg; + return 0; +} + +ACE_INLINE ACE_ES_Disjunction_Group * +ACE_ES_Consumer_Rep::top_group (void) +{ + return disjunction_group_; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep::reschedule_deadlines (void) +{ + if (disjunction_group_ != 0) + disjunction_group_->reschedule_deadline (); +} + +ACE_INLINE int +ACE_ES_Consumer_Rep::receiving_events (void) +{ + return suspended_ == 0 && disconnected_ == 0; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep::suspend (void) +{ + suspended_ = 1; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep::resume (void) +{ + suspended_ = 0; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep::_duplicate (void) +{ + // This is atomic. + ref_count_++; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep::_release (void) +{ + // This is atomic. rc is because we want to avoid Atomic_Op's + // operator==. Don't change this code unless you think you're more + // studly than ACE_Atomic_Op. + int rc = --ref_count_; + + if (rc == 0) + delete this; +} + +ACE_INLINE int +ACE_ES_Consumer_Rep::disconnected (void) +{ + return disconnected_; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep::disconnect (void) +{ + disconnected_ = 1; +} + +// ************************************************************ + +// Forward <events> to all consumers subscribed to <source> only. +ACE_INLINE int +ACE_ES_Subscription_Module::push_source (ACE_Push_Supplier_Proxy *source, + ACE_ES_Event_Container *event) +{ + ACE_TIMEPROBE (" enter ACE_ES_Subscription_Module::push"); + // If there are now source-based subscribers for this supplier, + // return. + if (source->subscription_info ().source_subscribers_.size () == 0) + return 0; + + ACE_ES_Subscription_Info::Subscriber_Set &set = + source->subscription_info ().source_subscribers_; + + // List of consumers that need to be disconnected. + ACE_ES_CRSet disconnect_list; + + { + // Acquire a read lock. + ACE_ES_RGUARD ace_mon (source->subscription_info ().lock_); + if (ace_mon.locked () == 0) + ACE_ERROR_RETURN ((LM_ERROR, "ACE_ES_Subscription_Module::push_source.\n"), -1); + + ACE_ES_Subscription_Info::Subscriber_Set_Iterator iter (set); + + ACE_TRY + { + // Iterate through all subscribers. + for (ACE_ES_Consumer_Rep **consumer = 0; + iter.next (consumer) != 0; + iter.advance ()) + { + // Only push the event if the consumer is not suspended + // and not disconnected. + if ((*consumer)->receiving_events ()) + { + up_->push (*consumer, event, ACE_TRY_ENV); + ACE_CHECK_ENV; + } + // If the consumer has disconnected, schedule it for + // disconnection. We can not modify our list now. It + // would mess up the iterator. + if ((*consumer)->disconnected ()) + disconnect_list.insert (*consumer); + } + } + ACE_CATCHANY + { + return -1; + } + ACE_ENDTRY; + + // Release the read lock. + } + + // If there are consumers scheduled for disconnect, acquire a write + // lock and disconnect them. + if (disconnect_list.size () != 0) + { + ACE_ES_WGUARD ace_mon (source->subscription_info ().lock_); + if (ace_mon.locked () == 0) + ACE_ERROR_RETURN ((LM_ERROR, "ACE_ES_Subscription_Module::push_source.\n"), -1); + + ACE_ES_CRSet_Iterator iter (disconnect_list.data (), disconnect_list.size ()); + + // Iterate through the disconnecting consumers. + for (ACE_ES_Consumer_Rep **consumer = 0; + iter.next (consumer) != 0; + iter.advance ()) + { + // Remove the consumer from subscriber list. + if (set.remove (*consumer) == -1) + ACE_ERROR ((LM_ERROR, "%p remove failed.\n", + "ACE_ES_Subscription_Module::push_source.\n")); + else + // Decrement the consumer rep's reference count. + (*consumer)->_release (); + } + } + + return 0; +} + +// 1. figure out why we're going through the subscription module, +// instead of just passing through. +// 2. where is lock_? Is there only one per module!? + +ACE_INLINE int +ACE_ES_Subscription_Module::push_source_type (ACE_Push_Supplier_Proxy *source, + ACE_ES_Event_Container *event) +{ + // Step through each event in the set. For each event type, find + // the corresponding set in the type collection. Push the single + // event to each consumer in the set. + + ACE_ES_Subscription_Info::Subscriber_Map &supplier_map = + source->subscription_info ().type_subscribers_; + + ACE_ES_CRSet disconnect_list; + + ACE_ES_Subscription_Info::Subscriber_Set *set; + + { + ACE_ES_RGUARD ace_mon (source->subscription_info ().lock_); + if (ace_mon.locked () == 0) + { + ACE_TIMEPROBE (" push_source_type"); + ACE_ERROR_RETURN ((LM_ERROR, "ACE_ES_Subscription_Module::push_source_type.\n"), -1); + } + + ACE_ES_Subscription_Info::Type_Subscribers *subscribers; + + if (supplier_map.current_size () == 0) + { + ACE_TIMEPROBE (" push_source_type"); + return 0; + } + + if (supplier_map.find (event->type_, subscribers) == -1) + { + ACE_DEBUG ((LM_ERROR, "ACE_ES_Subscription_Module::push_source_type" + " Warning: event type %d not registered.\n", event->type_)); + ACE_TIMEPROBE (" push_source_type"); + return 0; // continue anyway + } + + if (subscribers->consumers_.size () == 0) + { + ACE_TIMEPROBE (" push_source_type"); + return 0; + } + + set = &subscribers->consumers_; + + // We've found the set of consumers subscribed to this type + // of event from this supplier. Forward the event to each. + ACE_ES_Subscription_Info::Subscriber_Set_Iterator iter (*set); + + ACE_TRY + { + for (ACE_ES_Consumer_Rep **consumer = 0; + iter.next (consumer) != 0; + iter.advance ()) + { + if ((*consumer)->receiving_events ()) + { + up_->push (*consumer, event, ACE_TRY_ENV); + ACE_CHECK_ENV; + } + if ((*consumer)->disconnected ()) + disconnect_list.insert (*consumer); + } + } + ACE_CATCHANY + { + ACE_TIMEPROBE (" push_source_type"); + return -1; + } + ACE_ENDTRY; + } + + if (disconnect_list.size () != 0) + // Acquire a write lock and remove all disconnected consumers. + { + ACE_ES_WGUARD ace_mon (source->subscription_info ().lock_); + if (ace_mon.locked () == 0) + ACE_ERROR_RETURN ((LM_ERROR, "ACE_ES_Subscription_Module::push_source.\n"), -1); + + ACE_ES_CRSet_Iterator iter (disconnect_list.data (), disconnect_list.size ()); + + for (ACE_ES_Consumer_Rep **consumer = 0; + iter.next (consumer) != 0; + iter.advance ()) + { + if (set->remove (*consumer) == -1) + ACE_ERROR ((LM_ERROR, "%p remove failed.\n", + "ACE_ES_Subscription_Module::push_source.\n")); + else + (*consumer)->_release (); + } + } + + ACE_TIMEPROBE (" push_source_type"); + return 0; +} + +// ************************************************************ + +ACE_INLINE ACE_RTU_Manager * +ACE_EventChannel::rtu_manager (void) +{ + return rtu_manager_; +} + +ACE_INLINE +ACE_RTU_Manager::ACE_RTU_Manager (int active) + : active_ (active), + should_preempt_ (0), + not_done_ (0), + priority_ (ACE_Scheduler_MIN_PREEMPTION_PRIORITY) +{ +} + +ACE_INLINE int +ACE_RTU_Manager::should_preempt (void) +{ + if (!active_) + return 0; + else + { + // Expire any timers. Am I evil for putting this here? + ACE_Time_Value tv; + if (ACE_Task_Manager::instance ()-> + GetReactorTask (0)->get_reactor ().handle_events (&tv) == -1) + ACE_ERROR ((LM_ERROR, "%p.\n", + "ACE_RTU_Manager::should_preempt")); + + int should_preempt = should_preempt_; + should_preempt_ = 0; + return should_preempt; + } +} + +ACE_INLINE void +ACE_RTU_Manager::should_preempt (int s) +{ + should_preempt_ = s; +} + +ACE_INLINE int +ACE_RTU_Manager::not_done (void) +{ + int not_done = not_done_; + not_done_ = 0; + return not_done; +} + +ACE_INLINE void +ACE_RTU_Manager::not_done (int nd) +{ + not_done_ = nd; +} + +ACE_INLINE RtecScheduler::OS_Priority +ACE_RTU_Manager::priority (void) +{ + return priority_; +} + +ACE_INLINE void +ACE_RTU_Manager::priority (RtecScheduler::OS_Priority p) +{ + priority_ = p; +} + +// ************************************************************ + +ACE_INLINE +ACE_ES_Consumer_Rep_Timeout::ACE_ES_Consumer_Rep_Timeout (void) : + timer_id_ (0), + preemption_priority_ (ACE_Scheduler_MIN_PREEMPTION_PRIORITY), + timeout_event_ () +{ +} + +ACE_INLINE void +ACE_ES_Consumer_Rep_Timeout::init (ACE_ES_Consumer_Correlation *correlation, + RtecEventChannelAdmin::Dependency &dep) +{ + ACE_ES_Event_Container *temp = new ACE_ES_Event_Container (dep.event_); + if (temp == 0) + { + ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_ES_Consumer_Rep_Timeout::init")); + return; + } + + timeout_event_ = temp; + temp->_release (); + + ACE_ES_Consumer_Rep::init (correlation, dep); +} + +ACE_INLINE int +ACE_ES_Consumer_Rep_Timeout::timer_id (void) +{ + return timer_id_; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep_Timeout::timer_id (int id) +{ + timer_id_ = id; +} + +ACE_INLINE RtecScheduler::OS_Priority +ACE_ES_Consumer_Rep_Timeout::preemption_priority (void) +{ + return preemption_priority_; +} + +ACE_INLINE void +ACE_ES_Consumer_Rep_Timeout::preemption_priority (RtecScheduler::OS_Priority p) +{ + preemption_priority_ = p; +} + +// ************************************************************ + +ACE_INLINE void +ACE_ES_Consumer_Correlation::suspend (void) +{ + for (int x=0; x < n_timer_reps_; x++) + timer_reps_[x].suspend (); + + for (int y=0; y < n_consumer_reps_; y++) + consumer_reps_[y]->suspend (); +} + +ACE_INLINE void +ACE_ES_Consumer_Correlation::resume (void) +{ + for (int x=0; x < n_timer_reps_; x++) + timer_reps_[x].resume (); + + for (int y=0; y < n_consumer_reps_; y++) + consumer_reps_[y]->resume (); +} + +// ************************************************************ + +ACE_INLINE +ACE_ES_Dependency_Iterator::ACE_ES_Dependency_Iterator (RtecEventChannelAdmin::DependencySet &rep) : + rt_info_ (0), + rep_ (rep), + index_ (-1), + n_conjunctions_ (0), + n_disjunctions_ (0), + n_timeouts_ (0), + n_events_ (0) +{ +} + +ACE_INLINE int +ACE_ES_Dependency_Iterator::advance_dependency (void) +{ + index_++; + if ((CORBA::ULong) index_ >= rep_.length ()) + return -1; + else + return 0; +} + +ACE_INLINE RtecEventChannelAdmin::Dependency & +ACE_ES_Dependency_Iterator::operator *(void) +{ + return rep_[index_]; +} + +ACE_INLINE int +ACE_ES_Dependency_Iterator::parse (void) +{ + for (CORBA::ULong x = 0; x < rep_.length (); x++) + { + if (rt_info_ == 0) + rt_info_ = rep_[x].rt_info; + + switch (rep_[x].event_.type_) + { + case ACE_ES_CONJUNCTION_DESIGNATOR: + n_conjunctions_++; + break; + + case ACE_ES_DISJUNCTION_DESIGNATOR: + n_disjunctions_++; + break; + + case ACE_ES_EVENT_TIMEOUT: + case ACE_ES_EVENT_INTERVAL_TIMEOUT: + case ACE_ES_EVENT_DEADLINE_TIMEOUT: + n_timeouts_++; + break; + + default: + n_events_++; + break; + } + } + + return 0; +} + +ACE_INLINE int +ACE_ES_Dependency_Iterator::n_conjunctions (void) +{ + return n_conjunctions_; +} + +ACE_INLINE int +ACE_ES_Dependency_Iterator::n_disjunctions (void) +{ + return n_disjunctions_; +} + +ACE_INLINE int +ACE_ES_Dependency_Iterator::n_timeouts (void) +{ + return n_timeouts_; +} + +ACE_INLINE int +ACE_ES_Dependency_Iterator::n_events (void) +{ + return n_events_; +} + +ACE_INLINE RtecScheduler::handle_t +ACE_ES_Dependency_Iterator::first_rt_info (void) +{ + return rt_info_; +} + +// ************************************************************ + +ACE_INLINE +ACE_ES_Conjunction_Group::ACE_ES_Conjunction_Group (void) : + forward_value_ (0) +{ +} + +ACE_INLINE int +ACE_ES_Conjunction_Group::add_type (int type_id) +{ + ACE_SET_BITS (forward_value_, ACE_INT2BIT[type_id]); + return 0; +} + +/* + // Set length bits. + for (int x=0; x < length; x++) + { + forward_value_ <<= 1; + forward_value_ |= 1; + } + */ + +ACE_INLINE int +ACE_ES_Conjunction_Group::should_forward (u_long pending_flags) +{ + if ((forward_value_ & pending_flags) == forward_value_) + return 1; + else + return 0; +} + +ACE_INLINE void +ACE_ES_Conjunction_Group::add_events (Event_Set *outbox, + Event_Set *pending_events, + u_long &pending_flags) +{ + // Append the act first. + if (act_ != 0) + *outbox += act_; + + u_long fv = forward_value_; + int x = 0; + while (fv > 0) + { + // If this type_id is part of the correlation, then append each + // event pending to the outbox. + if (ACE_BIT_ENABLED (forward_value_, ACE_INT2BIT[x])) + { + // Step through each of the pending events. + Event_Set &pending = pending_events[x]; + for (CORBA::ULong y=0; y < pending.length (); y++) + { + // Add the pending event to the outbox. + if (outbox != 0) + *outbox += pending[y]; + // Remove the event from the pending events array. + pending[y] = 0; + } + + // Reset the array length. + pending.length (0); + // Since we just emptied the events for this type, clear the + // x^th bit in pending flags. + ACE_CLR_BITS (pending_flags, ACE_INT2BIT[x]); + // Clear the x^th bit in fv. + ACE_CLR_BITS (fv, ACE_INT2BIT[x]); + } + + x++; + } +} + +// ************************************************************ diff --git a/TAO/orbsvcs/Event_Service/Event_Service.cpp b/TAO/orbsvcs/Event_Service/Event_Service.cpp new file mode 100644 index 00000000000..dd0e89cfc02 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Event_Service.cpp @@ -0,0 +1,74 @@ +// +// $Id$ +// + +#include "ace/Get_Opt.h" +#include "tao/corba.h" + +#include "orbsvcs/CosNamingC.h" +#include "orbsvcs/Scheduler_Factory.h" +#include "orbsvcs/Event_Utilities.h" +#include "Event_Channel.h" + + + +int main (int argc, char *argv[]) +{ + ACE_TRY + { + // Initialize ORB. + CORBA::ORB_ptr orb = + CORBA::ORB_init (argc, argv, "internet", ACE_TRY_ENV); + ACE_CHECK_ENV; + + CORBA::POA_ptr poa = + orb->POA_init(argc, argv, "POA"); + if (poa == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + } + + CORBA::Object_ptr objref = + orb->resolve_initial_references ("NameService"); + ACE_CHECK_ENV; + + CosNaming::NamingContext_var naming_context = + CosNaming::NamingContext::_narrow (objref, ACE_TRY_ENV); + ACE_CHECK_ENV; + + ACE_DEBUG ((LM_DEBUG, "got reference to NameService\n")); + + ACE_Scheduler_Factory::use_config (naming_context.ptr ()); + + // Register Event_Service with Naming Service. + ACE_EventChannel* ec; + ACE_NEW_RETURN (ec, ACE_EventChannel, -1); + CORBA::Object::_duplicate(ec); + ACE_CHECK_ENV; + + CORBA::String str = + orb->object_to_string (ec, ACE_TRY_ENV); + ACE_OS::puts ((char *) str); + + CosNaming::Name channel_name (1); + channel_name[0].id = CORBA::string_dup ("EventService"); + channel_name.length (1); + naming_context->bind (channel_name, ec, ACE_TRY_ENV); + ACE_CHECK_ENV; + + orb->run (); + + CORBA::release (ec); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_TRY_ENV.print_exception ("EC"); + } + ACE_ENDTRY; + + + return 0; +} diff --git a/TAO/orbsvcs/Event_Service/Fast_Reactor.h b/TAO/orbsvcs/Event_Service/Fast_Reactor.h new file mode 100644 index 00000000000..d8af39b4f1d --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Fast_Reactor.h @@ -0,0 +1,49 @@ +// +// $Id$ +// +#if !defined (FAST_REACTOR_H) +#define FAST_REACTOR_H + +#if defined (ACE_OLD_STYLE_REACTOR) +# if defined (ACE_WIN32) +# include "ace/ReactorEx.h" +# define ACE_ES_FAST_REACTOR_BASE ACE_ReactorEx +# else +# include "ace/Reactor.h" +# define ACE_ES_FAST_REACTOR_BASE ACE_Reactor +# endif /* ACE_WIN32 */ +#else +# if defined (ACE_WIN32) +# include "ace/WFMO_Reactor.h" +# define ACE_ES_FAST_REACTOR_BASE ACE_WFMO_Reactor +# else +# include "ace/Select_Reactor.h" +# define ACE_ES_FAST_REACTOR_BASE ACE_Select_Reactor +# endif /* ACE_WIN32 */ +#endif /* ACE_OLD_STYLE_REACTOR */ +//## end module.includes + +class ACE_ES_Fast_Reactor : public ACE_ES_FAST_REACTOR_BASE +{ +public: + virtual int handle_events (ACE_Time_Value *max_wait_time = 0) + { + ACE_Time_Value timer_buf (0) ; + ACE_Time_Value *this_timeout = &timer_buf ; + + if (this->timer_queue_->calculate_timeout (max_wait_time, + this_timeout) == 0) + { + ACE_Time_Value t (0, 500000); + ACE_OS::select (0, 0, 0, 0, &t); + } + else + { + ACE_OS::select (0, 0, 0, 0, this_timeout); + } + + return this->timer_queue_->expire () == -1 ? -1 : 0; + } +}; + +#endif /* FAST_REACTOR_H */ diff --git a/TAO/orbsvcs/Event_Service/GPlot_File.cpp b/TAO/orbsvcs/Event_Service/GPlot_File.cpp new file mode 100644 index 00000000000..2f985e5d47c --- /dev/null +++ b/TAO/orbsvcs/Event_Service/GPlot_File.cpp @@ -0,0 +1,171 @@ +// $Id$ +// +// ============================================================================ +// +// = FILENAME +// GPlot_File.cpp +// +// = AUTHOR +// Tim Harrison +// +// ============================================================================ + +#include "GPlot_File.h" + +#if !defined (__ACE_INLINE__) +#include "GPlot_File.i" +#endif /* __ACE_INLINE__ */ + +int +ACE_GPlot_File::open (const char *filename) +{ + ACE_OS::strcpy (filename_, filename); + + FILE *read_file = ACE_OS::fopen (filename_, "r"); + + long entry; + char *value; + ACE_NEW_RETURN (value, char [32], -1); + + if (read_file > 0) + { + int result; + do + { + result = fscanf (read_file, + "%ld\t%s\n", + &entry, + value); + + //if ((result == -1) && (ACE_OS::last_error () != 0)) + //ACE_ERROR_RETURN ((LM_ERROR, "%p.\n", "ACE_GPlot_File::open"), -1); + + if (result > 0) + // Success. + map_.bind (entry, value); + else if (result != EOF) + // Error. + { + ACE_OS::fclose (read_file); + ACE_ERROR_RETURN + ((LM_ERROR, "Error reading GPlot file %s.\n", filename_), -1); + } + } while (result != EOF); + + fclose (read_file); + } + + write_file_ = ACE_OS::fopen (filename_, "w"); + if (write_file_ == 0) + ACE_ERROR_RETURN ((LM_ERROR, "%p: can't open\n", filename_), -1); + + closed_ = 0; + + return 0; +} + + +void +ACE_GPlot_File::close (void) +{ + if (closed_ == 0) + { + closed_ = 1; + GPLOT_ITERATOR iterator ((GPLOT_MAP &) map_); + for (GPLOT_ENTRY *entry; iterator.next (entry); iterator.advance ()) + { + ACE_OS::fprintf (write_file_, "%ld\t%s\n", + entry->ext_id_, entry->int_id_); + delete [] entry->int_id_; + } + + ACE_OS::fclose (write_file_); + } +} + + +void +ACE_GPlot_File::dump (void) +{ + GPLOT_ITERATOR iterator ((GPLOT_MAP &) map_); + for (GPLOT_ENTRY *entry; iterator.next (entry); iterator.advance ()) + { + if (entry->int_id_ != 0) + ACE_DEBUG ((LM_DEBUG, "%d\t%s\n", entry->ext_id_, entry->int_id_)); + else + { + ACE_ERROR ((LM_ERROR, "Value for entry %d is null.\n", + entry->ext_id_)); + return; + } + } +} + + +int +ACE_GPlot_File::get (long entry, long &value) +{ + char *val; + + if (map_.find (entry, val) == -1) + return -1; + else + { + ::sscanf (val, "%ld", &value); + return 0; + } +} + + +int +ACE_GPlot_File::get (long entry, float &value) +{ + char *val; + + if (map_.find (entry, val) == -1) + return -1; + else + { + ::sscanf (val, "%f", &value); + return 0; + } +} + + +void +ACE_GPlot_File::set (long entry, long value) +{ + long old_entry; + char *val; + char *old_value; + + ACE_NEW (val, char [32]); + + ::sprintf (val, "%ld", value); + map_.rebind (entry, val, old_entry, old_value); + + delete [] old_value; +} + + +void +ACE_GPlot_File::set (long entry, float value) +{ + long old_entry; + char *val; + char *old_value; + + ACE_NEW (val, char [32]); + + ::sprintf (val, "%f", value); + map_.rebind (entry, val, old_entry, old_value); + + delete [] old_value; +} + + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Map_Entry<long, char *>; +template class ACE_Map_Iterator<long, char *, ACE_Null_Mutex>; +template class ACE_Map_Manager<long, char *, ACE_Null_Mutex>; +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/Event_Service/GPlot_File.h b/TAO/orbsvcs/Event_Service/GPlot_File.h new file mode 100644 index 00000000000..dc6040d0ed7 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/GPlot_File.h @@ -0,0 +1,96 @@ +// $Id$ +// +// ============================================================================ +// +// = FILENAME +// GPlot_File.h +// +// = AUTHOR +// Tim Harrison +// +// ============================================================================ + +#if !defined (ACE_GPlot_File_H) +#define ACE_GPlot_File_H + +#include "ace/Map_Manager.h" +#include "ace/Synch.h" + +class ACE_GPlot_File +// = TITLE +// Reads and writes files in GPlot format. +// +// = DESCRIPTION +// Gplot formats are as follows: +// entry value +// entry value +// entry value +// ... +// They represent x,y pairs to be graphed by GPlot. entry's are +// type long. value's are type long or float. +{ +public: + ACE_GPlot_File (void); + // Construction. + + ~ACE_GPlot_File (void); + // Destruction. Calls this->close. + + int open (const char *filename); + // If the file does not exist, create it. If the file exists open + // the file and read all the entries into map_. Returns 0 on + // success, -1 on failure. + + void close (void); + // Close the file and sync all the contents. + + int get (long entry, long &value); + // Get the entry at this value. Returns 0 if a value was found. + // Returns -1 if no value has been set for <entry>. + + int get (long entry, float &value); + // Get the entry at this value. Returns 0 if a value was found. + // Returns -1 if no value has been set for <entry>. + + void set (long entry, long value); + // Set the entry at this value. + + void set (long entry, float value); + // Set the entry at this value. + + void set_greatest (long entry, long value); + // Compare <value> with the value at <entry>. Store the largest. + + void set_greatest (long entry, float value); + // Compare <value> with the value at <entry>. Store the largest. + + void set_least (long entry, long value); + // Compare <value> with the value at <entry>. Store the smallest. + + void set_least (long entry, float value); + // Compare <value> with the value at <entry>. Store the smallest. + + void dump (void); + // Dump state of the object. + +private: + // = map_ stores all values. It is sync'ed to file when this->close + // is called. + typedef ACE_Map_Entry <long, char *> GPLOT_ENTRY; + typedef ACE_Map_Iterator <long, char *, ACE_Null_Mutex> GPLOT_ITERATOR; + typedef ACE_Map_Manager<long, char *, ACE_Null_Mutex> GPLOT_MAP; + GPLOT_MAP map_; + + char filename_[BUFSIZ]; + FILE *write_file_; + + int closed_; + // Only close once. +}; + +#if defined (__ACE_INLINE__) +#include "GPlot_File.i" +#endif /* __ACE_INLINE__ */ + + +#endif /* ACE_GPlot_File_H */ diff --git a/TAO/orbsvcs/Event_Service/GPlot_File.i b/TAO/orbsvcs/Event_Service/GPlot_File.i new file mode 100644 index 00000000000..ab9f235dc39 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/GPlot_File.i @@ -0,0 +1,70 @@ +// $Id$ + +ACE_INLINE +ACE_GPlot_File::ACE_GPlot_File (void) + : closed_ (1) +{ +} + + +ACE_INLINE +ACE_GPlot_File::~ACE_GPlot_File (void) +{ + this->close (); +} + + +ACE_INLINE +void +ACE_GPlot_File::set_greatest (long entry, long value) +{ + long old_value; + + // If there was no previous value, or the <value> is greater than + // the previous value, set a new value. + if (this->get (entry, old_value) == -1 || + value > old_value) + this->set (entry, value); +} + + +ACE_INLINE +void +ACE_GPlot_File::set_greatest (long entry, float value) +{ + float old_value; + + // If there was no previous value, or the <value> is greater than + // the previous value, set a new value. + if (this->get (entry, old_value) == -1 || + value > old_value) + this->set (entry, value); +} + + +ACE_INLINE +void +ACE_GPlot_File::set_least (long entry, long value) +{ + long old_value; + + // If there was no previous value, or the <value> is less than + // the previous value, set a new value. + if (this->get (entry, old_value) == -1 || + value < old_value) + this->set (entry, value); +} + + +ACE_INLINE +void +ACE_GPlot_File::set_least (long entry, float value) +{ + float old_value; + + // If there was no previous value, or the <value> is less than + // the previous value, set a new value. + if (this->get (entry, old_value) == -1 || + value < old_value) + this->set (entry, value); +} diff --git a/TAO/orbsvcs/Event_Service/Local_ESTypes.cpp b/TAO/orbsvcs/Event_Service/Local_ESTypes.cpp new file mode 100644 index 00000000000..ebfd367dc9a --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Local_ESTypes.cpp @@ -0,0 +1,9 @@ +// +// $Id$ +// + +#include "Local_ESTypes.h" + +#if !defined (__ACE_INLINE__) +#include "Local_ESTypes.i" +#endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/Event_Service/Local_ESTypes.h b/TAO/orbsvcs/Event_Service/Local_ESTypes.h new file mode 100644 index 00000000000..bf34edee6cc --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Local_ESTypes.h @@ -0,0 +1,62 @@ +/* -*- C++ -*- */ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// ORB Services +// +// = FILENAME +// Local_ESTypes.h +// +// = AUTHOR +// Tim Harrison (harrison@cs.wustl.edu) +// +// = DESCRIPTION +// Manual types that would otherwise be defined/implemented via an +// IDL compiler. +// NOTE: the file is obsolecent, we have TAO now, but we keep it +// to speed up the porting. +// +// ============================================================================ + +#ifndef ACE_LOCAL_ESTYPES_H +#define ACE_LOCAL_ESTYPES_H + +#include "tao/corba.h" + +#include "orbsvcs/Event_Service_Constants.h" + +#include "orbsvcs/CosNamingC.h" +#include "orbsvcs/RtecSchedulerC.h" +#include "orbsvcs/RtecSchedulerS.h" +#include "orbsvcs/RtecEventCommC.h" +#include "orbsvcs/RtecEventCommS.h" +#include "orbsvcs/RtecEventChannelAdminC.h" +#include "orbsvcs/RtecEventChannelAdminS.h" + +#define ACE_DEFAULT_EVENT_CHANNEL_TYPE 0 + +// These are to help MSVC++ 4.2 deal with inheritence of nested types. +// Not needed for Sun C++ or MSVC++ 5.0. + +// @@ NOTE: TAO uses the POA mapping instead of the old BOA, but all the +// code still uses the BOA name for the skeleton classes, to speed up +// porting we keep to old names. + +typedef RtecEventComm::Event RtecEventComm_Event; +typedef POA_RtecScheduler::Scheduler RtecScheduler_SchedulerBOAImpl; +typedef POA_RtecEventChannelAdmin::EventChannel RtecEventChannelAdmin_EventChannelBOAImpl; +typedef POA_RtecEventComm::PushSupplier RtecEventComm_PushSupplierBOAImpl; +typedef POA_RtecEventChannelAdmin::ConsumerAdmin RtecEventChannelAdmin_ConsumerAdminBOAImpl; +typedef POA_RtecEventChannelAdmin::SupplierAdmin RtecEventChannelAdmin_SupplierAdminBOAImpl; +typedef POA_RtecEventChannelAdmin::ProxyPushConsumer RtecEventChannelAdmin_ProxyPushConsumerBOAImpl; +typedef POA_RtecEventChannelAdmin::ProxyPushSupplier RtecEventChannelAdmin_ProxyPushSupplierBOAImpl; +typedef POA_RtecEventComm::PushConsumer RtecEventComm_PushConsumerBOAImpl; +typedef POA_RtecEventComm::PushSupplier RtecEventComm_PushSupplierBOAImpl; + +#if defined (__ACE_INLINE__) +#include "Local_ESTypes.i" +#endif /* __ACE_INLINE__ */ + +#endif /* ACE_LOCAL_ESTYPES_H */ diff --git a/TAO/orbsvcs/Event_Service/Local_ESTypes.i b/TAO/orbsvcs/Event_Service/Local_ESTypes.i new file mode 100644 index 00000000000..8f8ef4cfe2d --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Local_ESTypes.i @@ -0,0 +1,5 @@ +/* -*- C++ -*- */ +// +// $Id$ +// + diff --git a/TAO/orbsvcs/Event_Service/Makefile b/TAO/orbsvcs/Event_Service/Makefile new file mode 100644 index 00000000000..4efa9b35a1f --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Makefile @@ -0,0 +1,1843 @@ +# +# $Id$ +# + +BIN = Event_Service +BUILD = $(BIN) + +LSRC = \ + Event_Service.cpp \ + BCU.cpp \ + CORBA_Utils_T.cpp \ + Dispatching_Modules.cpp \ + Event_Channel.cpp \ + GPlot_File.cpp \ + Local_ESTypes.cpp \ + Memory_Pools.cpp \ + RT_Task.cpp \ + ReactorTask.cpp \ + Task_Manager.cpp \ + +ES_OBJS=$(LSRC:.cpp=.o) + +LDLIBS = -lorbsvcs -lTAO + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +#include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif +TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE +DCFLAGS = -g +LDFLAGS += -L$(TAO_ROOT)/orbsvcs/orbsvcs -L$(TAO_ROOT)/tao +CPPFLAGS += -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H + +ifeq ($(probe),1) + CCFLAGS += -DACE_ENABLE_TIMEPROBES +endif # probe + + +Event_Service: $(addprefix $(VDIR),$(ES_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +.obj/Event_Service.o .shobj/Event_Service.: Event_Service.cpp \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Utilities.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Utilities.i \ + Event_Channel.h \ + $(TAO_ROOT)/tao/Timeprobe.h \ + $(TAO_ROOT)/tao/Timeprobe.i \ + Local_ESTypes.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.i \ + Local_ESTypes.i CORBA_Utils_T.h CORBA_Utils_T.i Task_Manager.h \ + RT_Task.h RT_Task.i Task_Manager.i ReactorTask.h Fast_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor.i \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_List.h \ + $(ACE_ROOT)/ace/Timer_List_T.h \ + Event_Channel.i +.obj/BCU.o .shobj/BCU.: BCU.cpp BCU.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i +.obj/CORBA_Utils_T.o .shobj/CORBA_Utils_T.: CORBA_Utils_T.cpp CORBA_Utils_T.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + CORBA_Utils_T.i +.obj/Dispatching_Modules.o .shobj/Dispatching_Modules.: Dispatching_Modules.cpp \ + $(ACE_ROOT)/ace/Sched_Params.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Sched_Params.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.i \ + Memory_Pools.h Event_Channel.h \ + $(TAO_ROOT)/tao/Timeprobe.h \ + $(TAO_ROOT)/tao/Timeprobe.i \ + Local_ESTypes.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.i \ + Local_ESTypes.i CORBA_Utils_T.h CORBA_Utils_T.i Task_Manager.h \ + RT_Task.h RT_Task.i Task_Manager.i ReactorTask.h Fast_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor.i \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_List.h \ + $(ACE_ROOT)/ace/Timer_List_T.h \ + Event_Channel.i Dispatching_Modules.h Dispatching_Modules.i \ + Memory_Pools.i +.obj/Event_Channel.o .shobj/Event_Channel.: Event_Channel.cpp \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.i \ + Dispatching_Modules.h \ + $(TAO_ROOT)/tao/Timeprobe.h \ + $(TAO_ROOT)/tao/Timeprobe.i \ + ReactorTask.h Fast_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor.i \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_List.h \ + $(ACE_ROOT)/ace/Timer_List_T.h \ + Local_ESTypes.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.i \ + Local_ESTypes.i RT_Task.h RT_Task.i Event_Channel.h CORBA_Utils_T.h \ + CORBA_Utils_T.i Task_Manager.h Task_Manager.i Event_Channel.i \ + Dispatching_Modules.i Memory_Pools.h Memory_Pools.i +.obj/GPlot_File.o .shobj/GPlot_File.: GPlot_File.cpp GPlot_File.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + GPlot_File.i +.obj/Local_ESTypes.o .shobj/Local_ESTypes.: Local_ESTypes.cpp Local_ESTypes.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.i \ + Local_ESTypes.i +.obj/Memory_Pools.o .shobj/Memory_Pools.: Memory_Pools.cpp Memory_Pools.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + Event_Channel.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(TAO_ROOT)/tao/Timeprobe.h \ + $(TAO_ROOT)/tao/Timeprobe.i \ + Local_ESTypes.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.i \ + Local_ESTypes.i CORBA_Utils_T.h CORBA_Utils_T.i Task_Manager.h \ + RT_Task.h RT_Task.i Task_Manager.i ReactorTask.h Fast_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor.i \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_List.h \ + $(ACE_ROOT)/ace/Timer_List_T.h \ + Event_Channel.i Dispatching_Modules.h Dispatching_Modules.i \ + Memory_Pools.i +.obj/RT_Task.o .shobj/RT_Task.: RT_Task.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.i \ + RT_Task.h RT_Task.i Debug_Macros.h Event_Channel.h \ + $(TAO_ROOT)/tao/Timeprobe.h \ + $(TAO_ROOT)/tao/Timeprobe.i \ + Local_ESTypes.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.i \ + Local_ESTypes.i CORBA_Utils_T.h CORBA_Utils_T.i Task_Manager.h \ + Task_Manager.i ReactorTask.h Fast_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor.i \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_List.h \ + $(ACE_ROOT)/ace/Timer_List_T.h \ + Event_Channel.i Memory_Pools.h Dispatching_Modules.h \ + Dispatching_Modules.i Memory_Pools.i +.obj/ReactorTask.o .shobj/ReactorTask.: ReactorTask.cpp \ + $(ACE_ROOT)/ace/High_Res_Timer.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/High_Res_Timer.i \ + $(TAO_ROOT)/tao/Timeprobe.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(TAO_ROOT)/tao/Timeprobe.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.i \ + ReactorTask.h Fast_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor.i \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_List.h \ + $(ACE_ROOT)/ace/Timer_List_T.h \ + Local_ESTypes.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.i \ + Local_ESTypes.i RT_Task.h RT_Task.i +.obj/Task_Manager.o .shobj/Task_Manager.: Task_Manager.cpp Task_Manager.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Singleton.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + RT_Task.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + RT_Task.i Task_Manager.i ReactorTask.h Fast_Reactor.h \ + $(ACE_ROOT)/ace/Select_Reactor.h \ + $(ACE_ROOT)/ace/Token.h \ + $(ACE_ROOT)/ace/Token.i \ + $(ACE_ROOT)/ace/Pipe.h \ + $(ACE_ROOT)/ace/Pipe.i \ + $(ACE_ROOT)/ace/Select_Reactor.i \ + $(ACE_ROOT)/ace/Timer_Heap.h \ + $(ACE_ROOT)/ace/Timer_Heap_T.h \ + $(ACE_ROOT)/ace/Timer_List.h \ + $(ACE_ROOT)/ace/Timer_List_T.h \ + Local_ESTypes.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminS.i \ + Local_ESTypes.i + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/Event_Service/Memory_Pools.cpp b/TAO/orbsvcs/Event_Service/Memory_Pools.cpp new file mode 100644 index 00000000000..3cbcd71d8b5 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Memory_Pools.cpp @@ -0,0 +1,33 @@ +// $Id$ + +#include "Memory_Pools.h" +#include "Event_Channel.h" + +#if !defined (__ACE_INLINE__) +#include "Memory_Pools.i" +#endif /* __ACE_INLINE__ */ + +ACE_TSS<ACE_ES_Dispatch_Request_Allocator> ACE_ES_Memory_Pools::Dispatch_Request_; +ACE_TSS<ACE_ES_Event_Container_Allocator> ACE_ES_Memory_Pools::Event_Container_; +ACE_TSS<ACE_ES_Event_Allocator> ACE_ES_Memory_Pools::Event_; + +// ************************************************************ + +int +ACE_ES_Memory_Pools::thr_init (void) +{ + // Allocate the memory pool for this thread. + Event_Container_.ts_object (); + Dispatch_Request_.ts_object (); + Event_.ts_object (); + return 0; +} + +// ************************************************************ + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +// For ACE_ES_Memory_Pools. +template class ACE_TSS<ACE_ES_Event_Container_Allocator>; +template class ACE_TSS<ACE_ES_Dispatch_Request_Allocator>; +template class ACE_TSS<ACE_Malloc<ACE_Local_Memory_Pool, ACE_Local_Memory_Pool_Options, ACE_MEMORY_POOL_MUTEX> >; +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/Event_Service/Memory_Pools.h b/TAO/orbsvcs/Event_Service/Memory_Pools.h new file mode 100644 index 00000000000..cc8a23f6767 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Memory_Pools.h @@ -0,0 +1,104 @@ +/* -*- C++ -*- */ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// ORB Services +// +// = FILENAME +// Memory_Pools +// +// = AUTHOR +// Tim Harrison (harrison@cs.wustl.edu) +// +// ============================================================================ + +#ifndef ACE_MEMORY_POOLS_H +#define ACE_MEMORY_POOLS_H + +#include "ace/Synch.h" +#include "Event_Channel.h" +#include "Dispatching_Modules.h" + +// ************************************************************ + +#if defined (ACE_HAS_THREAD_SPECIFIC_STORAGE) || defined (ACE_HAS_TSS_EMULATION) + typedef ACE_Null_Mutex ACE_MEMORY_POOL_MUTEX; +#else + // Use the same object for each thread. Therefore, we have to use + // real synchronization. + typedef ACE_Thread_Mutex ACE_MEMORY_POOL_MUTEX; +#endif /* ACE_HAS_THREAD_SPECIFIC_STORAGE || ACE_HAS_TSS_EMULATION */ + +typedef char ACE_ES_Dispatch_Request_Chunk[sizeof (ACE_ES_Dispatch_Request)]; + +typedef ACE_Cached_Allocator<ACE_ES_Dispatch_Request_Chunk, ACE_MEMORY_POOL_MUTEX> _ACE_Dispatch_Request_Allocator; + +class ACE_ES_Dispatch_Request_Allocator : public _ACE_Dispatch_Request_Allocator +// = TITLE +// Dispatch Request Allocator +// +// = DESCRIPTION +// This just sets the size of the Event Container memory pool. +{ +public: + ACE_ES_Dispatch_Request_Allocator (void) : + _ACE_Dispatch_Request_Allocator (ACE_ES_DISPATCH_REQUEST_MEMORY_POOL) {} +}; + +// ************************************************************ + +typedef char ACE_ES_Event_Container_Chunk[sizeof (ACE_ES_Event_Container)]; + +typedef ACE_Cached_Allocator<ACE_ES_Event_Container_Chunk, ACE_MEMORY_POOL_MUTEX> _ACE_Event_Container_Allocator; + +class ACE_ES_Event_Container_Allocator : public _ACE_Event_Container_Allocator +// = TITLE +// Event Container Allocator +// +// = DESCRIPTION +// This just sets the size of the Event Container memory pool. +{ +public: + ACE_ES_Event_Container_Allocator (void) : + _ACE_Event_Container_Allocator (ACE_ES_EVENT_CONTAINER_MEMORY_POOL) {} +}; + +// ************************************************************ + +typedef char ACE_ES_Event_Chunk[sizeof (RtecEventComm::Event)]; + +typedef ACE_Malloc<ACE_LOCAL_MEMORY_POOL, ACE_MEMORY_POOL_MUTEX> ACE_ES_Event_Allocator; +//typedef ACE_Cached_Allocator<ACE_ES_Event_Chunk, ACE_MEMORY_POOL_MUTEX> _ACE_Event_Allocator; + +class ACE_ES_Memory_Pools +// = TITLE +// Event Service Memory Pools. +// +// = DESCRIPTION +// These have to be static in order to be accessed by operator +// news, right? +{ +public: + static int thr_init (void); + // This can be called by every thread that will access these memory + // pools to preallocate the thread specific allocators. It is not + // mandatory. + + static void *new_Event_Container (void); + static void delete_Event_Container (void *); + static void *new_Dispatch_Request (void); + static void delete_Dispatch_Request (void *); + static void *new_Event (size_t); + static void delete_Event (void *); + + static ACE_TSS<ACE_ES_Dispatch_Request_Allocator> Dispatch_Request_; + static ACE_TSS<ACE_ES_Event_Container_Allocator> Event_Container_; + static ACE_TSS<ACE_ES_Event_Allocator> Event_; +}; + +#if defined (__ACE_INLINE__) +#include "Memory_Pools.i" +#endif /* __ACE_INLINE__ */ +#endif /* ACE_MEMORY_POOLS_H */ diff --git a/TAO/orbsvcs/Event_Service/Memory_Pools.i b/TAO/orbsvcs/Event_Service/Memory_Pools.i new file mode 100644 index 00000000000..3f6e3b26223 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Memory_Pools.i @@ -0,0 +1,54 @@ +/* -*- C++ -*- */ +// $Id$ + +ACE_INLINE void * +ACE_ES_Memory_Pools::new_Event_Container (void) +{ + return Event_Container_->malloc (sizeof (ACE_ES_Event_Container)); +} + +ACE_INLINE void +ACE_ES_Memory_Pools::delete_Event_Container (void *mem) +{ + Event_Container_->free (mem); +} + +ACE_INLINE void * +ACE_ES_Memory_Pools::new_Dispatch_Request (void) +{ + return Dispatch_Request_->malloc (sizeof (ACE_ES_Dispatch_Request)); +} + +ACE_INLINE void +ACE_ES_Memory_Pools::delete_Dispatch_Request (void *mem) +{ + Dispatch_Request_->free (mem); +} + +#define USE_MEM_POOLS 1 + +ACE_INLINE void * +ACE_ES_Memory_Pools::new_Event (size_t len) +{ +#if USE_MEM_POOLS + const u_int ev_size = sizeof (RtecEventComm::Event); + const u_int size = (ev_size % ACE_MALLOC_ALIGN) ? + ((ev_size / ACE_MALLOC_ALIGN) + 1) * ACE_MALLOC_ALIGN : ev_size; + + char *const addr = (char *) Event_->malloc (len * size); +#else + char *const addr = new char[len * sizeof (ACE_ES_Event)]; +#endif + + return addr; +} + +ACE_INLINE void +ACE_ES_Memory_Pools::delete_Event (void *mem) +{ +#if USE_MEM_POOLS + Event_->free (mem); +#else + delete [] mem; +#endif +} diff --git a/TAO/orbsvcs/Event_Service/RT_Task.cpp b/TAO/orbsvcs/Event_Service/RT_Task.cpp new file mode 100644 index 00000000000..b70bacf40b8 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/RT_Task.cpp @@ -0,0 +1,363 @@ +// $Id$ + +#include "orbsvcs/Scheduler_Factory.h" +#include "RT_Task.h" +#include "Debug_Macros.h" +#include "Event_Channel.h" +#include "Memory_Pools.h" + +#if !defined (__ACE_INLINE__) +#include "RT_Task.i" +#endif /* __ACE_INLINE__ */ + +class ACE_RT_Task_Shutdown : public ACE_RT_Task_Command +// = TITLE +// Flush Queue Command. +// +// = DESCRIPTION +// This command object will call close on task_. This is used by +// single-threaded tasks to flush any queued messages. +{ +public: + ACE_RT_Task_Shutdown (ACE_ES_TASK *task) + : task_ (task) {} + + virtual int execute (u_long &command_action); + + ACE_ES_TASK *task_; +}; + +int +ACE_RT_Task_Shutdown::execute (u_long &command_action) +{ + ACE_UNUSED_ARG (command_action); + + if (task_ == 0) + return 1; + else + { + task_->close (0); + return 0; + } +} + +// ************************************************************ +// ************************************************************ + +ACE_RT_Task::ACE_RT_Task (void) + : closed_ (0) +{ +} + +ACE_RT_Task::~ACE_RT_Task (void) +{ + msg_queue_->deactivate (); +} + +int +ACE_RT_Task::svc (void) +{ + int done = 0; + + ACE_hthread_t self; + ACE_OS::thr_self (self); + + int priority; + if (ACE_OS::thr_getprio (self, priority) == 0) + ACE_DEBUG ((LM_DEBUG, "(%t) new thread priority = %d.\n", priority)); + + // Initialize channel thread-specific data. + ACE_ES_Memory_Pools::thr_init (); + + done = this->svc_hook (priority); + + while (!done) + { + done = this->svc_one (); + } + + ACE_DEBUG ((LM_DEBUG, "(%t) thread exiting.\n")); + return 0; +} + +int +ACE_RT_Task::svc_hook (RtecScheduler::OS_Priority) +{ + return 0; +} + +int +ACE_RT_Task::svc_one (void) +{ + // Dequeue the command. + ACE_Message_Block *mb; + + if (this->getq (mb) == -1) + { + if (ACE_OS::last_error () == ESHUTDOWN) + return 1; + else + // We'll continue in spite of this error. + ACE_ERROR ((LM_ERROR, "%p (%t) getq error.\n", "ACE_RT_Task::svc_one")); + } + + // Execute the command. + ACE_RT_Task_Command *command = (ACE_RT_Task_Command *) mb; + + int result; + u_long command_action = ACE_RT_Task_Command::RELEASE; + + ACE_TIMEPROBE (" RT_Task - start execute"); + + // @@ Put exception handling around this! + result = command->execute (command_action); + + ACE_TIMEPROBE (" RT_Task - end execute"); + + switch (command_action) + { + case ACE_RT_Task_Command::RELEASE: + // Free the message block. + if (ACE_RT_Task_Command::release (command) != 0) + ACE_ERROR ((LM_ERROR, "ACE_RT_Task::svc_one: " + "ACE_RT_Task_Command::release returned != 0!\n")); + break; + + case ACE_RT_Task_Command::UNGETQ: + this->ungetq (command); + break; + } + + return result; +} + +// A thread has exited. +int +ACE_RT_Task::close (u_long) +{ + // If we're the last one out, call threads_closed. + if (thr_count_ == 0) + this->threads_closed (); + + return 0; +} + +// All threads have exited. +void +ACE_RT_Task::threads_closed (void) +{ +} + +int +ACE_RT_Task::open_task (const char* name) +{ + const char *tempname = name; + char tempbuffer[64]; + if (tempname == 0) + { + ACE_OS::sprintf (tempbuffer, "unnamed task %d", (long) this); + tempname = tempbuffer; + } + + ACE_TRY + { + rt_info_ = + ACE_Scheduler_Factory::server()->create (tempname, + ACE_TRY_ENV); + ACE_CHECK_ENV; + // @@ TODO: We do no initialization of the new rt_info, the + // caller does, this is (IMnsHO) very error prone. + } + ACE_CATCH (RtecScheduler::DUPLICATE_NAME, dn_ex) + { + // @@ TODO: Its already registered, IMHO this should at least + // report a warning, but I'll stick to the previous code. + // ACE_ERROR_RETURN ((LM_WARNING, + // "RT_Info for %s was already createn", + // tempname), 0); + return 0; + } + ACE_ENDTRY; + + return 0; +} + +int +ACE_RT_Task::try_put (ACE_Message_Block *mb) +{ + if (!closed_) + { + return this->msg_queue ()->enqueue_prio (mb); + } + else + { + errno = EPIPE; + return -1; + } +} + +// The point of this method is to spawn or shutdown threads depending +// on any differences between the task's RT_Info::threads_ and how +// many threads are actually running. +int +ACE_RT_Task::synch_threads (size_t threads) +{ + if (threads > this->thr_count ()) + // Add threads. + { + RtecScheduler::OS_Priority thread_priority; + RtecScheduler::Sub_Priority subpriority; + RtecScheduler::Preemption_Priority preemption_priority; + + ACE_TRY + { + // @@ TODO handle exceptions + ACE_TIMEPROBE (" synch_threads - priority requested"); + ACE_Scheduler_Factory::server ()->priority + (rt_info_, + thread_priority, + subpriority, + preemption_priority, ACE_TRY_ENV); + ACE_CHECK_ENV; + ACE_TIMEPROBE (" synch_threads - priority obtained"); + + ACE_DEBUG ((LM_DEBUG, "(%t) spawning %d threads at os thread" + " priority %d.\n", + threads - this->thr_count (), + thread_priority)); + + // This is here so that the constructor does not call it. The + // ORB has an instance of one of these. + this->thr_mgr (ACE_Task_Manager::instance ()->ThrMgr ()); + + // Add the difference. + if (this->activate (THR_BOUND, + threads - this->thr_count (), + 1, // Force it to spawn more threads + thread_priority) == -1) + { + ACE_DEBUG ((LM_ERROR, + "(%t) thread spawn FAILED, errno is %d!!!!\n", + errno)); + } + + } + ACE_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, "priority failed\n"), -1); + } + ACE_ENDTRY; + + } + else + // Remove threads. + { + // kill_threads has to be off the stack in case the last thread + // deletes this RT_Task. + int kill_threads = this->thr_count () - threads; + + for (int x = kill_threads ; x > 0; x--) + { + // Create a new shutdown command with a task pointer of 0. + ACE_RT_Task_Shutdown *te = new ACE_RT_Task_Shutdown (0); + + if (te == 0) + return -1; + + ACE_DEBUG ((LM_DEBUG, "(%t) enqueueing thread exit.\n")); + if (this->putq (te) == -1) + { + ACE_ERROR ((LM_ERROR, "%p putq failed.\n", + "ACE_RT_Task::synch_threads")); + if (ACE_RT_Task_Shutdown::release (te) != 0) + ACE_ERROR ((LM_ERROR, "ACE_RT_Task::synch_threads: " + "ACE_RT_Task_Shutdown::release returned != 0!\n")); + return -1; + } + } + } + + return 0; +} + + +// If we are not active, we will flush the queue and then call +// this->close. Otherwise, we will send shutdown messages to each +// thread. ~ACE_Task_Exit will call this->close when each thread +// exits. +int +ACE_RT_Task::shutdown_task (void) +{ + // Be sure to only execute this once, and only if we're active. + if (closed_) + return 0; + + // This will keep any messages from entering the queue. + closed_ = 1; + + if (thr_count_ > 0) + return this->synch_threads (0); + else + { + // Create a new flush queue command. We're passive, so pass in + // a reference to the task for which close will be called. + ACE_RT_Task_Shutdown *fq = new ACE_RT_Task_Shutdown (this); + + if (fq == 0) + { + ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_RT_Task::shutdown_threads")); + return -1; + } + + // Enqueue the command. + ACE_DEBUG ((LM_DEBUG, "(%t) enqueueing task shutdown.\n")); + if (this->putq (fq) == -1) + { + ACE_ERROR ((LM_ERROR, "%p putq failed.\n", + "ACE_RT_Task::shutdown_task")); + if (ACE_RT_Task_Shutdown::release (fq) != 0) + ACE_ERROR ((LM_ERROR, "ACE_RT_Task::shutdown_task: " + "ACE_RT_Task_Shutdown::release returned != 0!\n")); + return -1; + } + } + + return 0; +} + +// ************************************************************ + +ACE_RT_Thread_Manager::ACE_RT_Thread_Manager (void) + : flags_ (0) +{ +} + +void +ACE_RT_Thread_Manager::suspend_spawns (void) +{ + flags_ |= THR_SUSPENDED; +} + +void +ACE_RT_Thread_Manager::unsuspend_spawns (void) +{ + flags_ = 0; + this->resume_all (); +} + +int +ACE_RT_Thread_Manager::spawn_i (ACE_THR_FUNC func, + void *args, + long flags, + ACE_thread_t *t_id, + ACE_hthread_t *t_handle, + long priority, + int grp_id, + void *stack, + size_t stack_size, + ACE_Task_Base *task) +{ + flags |= flags_; + return ACE_Thread_Manager::spawn_i (func, args, flags, t_id, t_handle, + priority, grp_id, stack, stack_size, task); +} diff --git a/TAO/orbsvcs/Event_Service/RT_Task.h b/TAO/orbsvcs/Event_Service/RT_Task.h new file mode 100644 index 00000000000..1b09ee4ac7a --- /dev/null +++ b/TAO/orbsvcs/Event_Service/RT_Task.h @@ -0,0 +1,179 @@ +/* -*- C++ -*- */ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// ace +// +// = FILENAME +// RT_Task +// +// = AUTHOR +// Tim Harrison (harrison@cs.wustl.edu) +// +// = DESCRIPTION +// Wrapper on top of ACE Task that integrates an Active Object with +// the Event Service. +// +// ============================================================================ + +#ifndef ACE_RT_TASK_H +#define ACE_RT_TASK_H + +#include "ace/Task.h" + +#include "orbsvcs/RtecSchedulerC.h" + +class ACE_RT_Thread_Manager : public ACE_Thread_Manager +// = TITLE +// +// = DESCRIPTION +{ +public: + ACE_RT_Thread_Manager (void); + // Default construction. + + void suspend_spawns (void); + // Any threads spawned will be suspended until unsuspend_spawns is + // called. + + void unsuspend_spawns (void); + // Resumes all threads. + +protected: + virtual int spawn_i (ACE_THR_FUNC func, + void *args, + long flags, + ACE_thread_t * = 0, + ACE_hthread_t *t_handle = 0, + long priority = 0, + int grp_id = -1, + void *stack = 0, + size_t stack_size = 0, + ACE_Task_Base *task = 0); + + int flags_; +}; + +// ************************************************************ + +class ACE_RT_Task_Command : public ACE_Message_Block +// = TITLE +// +// = DESCRIPTION +{ +public: + virtual ~ACE_RT_Task_Command (void) {} + // Guarantees that derived destructors get called. + + enum { RELEASE, UNGETQ }; + + virtual int execute (u_long &command_action) = 0; + // Execute the command. Returning 1 will make the calling thread + // exit. Returning 0 will allow the thread to continue dispatching + // commands. If <command_action> returns as RELEASE, the command + // will be released. If <command_action> == UNGETQ, then the + // command will be requeued and dispatched again. +}; + +// ************************************************************ + +// In Synch_T.h: +// #define ACE_MT_SYNCH ACE_Thread_Mutex,ACE_Condition_Thread_Mutex + +typedef ACE_Task<ACE_MT_SYNCH> ACE_ES_TASK; +typedef ACE_Message_Queue<ACE_MT_SYNCH> ACE_ES_QUEUE; + +class ACE_RT_Task : public ACE_ES_TASK +// = TITLE +// ACE Real-Time Task +// +// = DESCRIPTION +// Real-Time Active Object that integrates with a global scheduler +// and Event Service. For now, none of the management methods are +// synchronized. If it turns out that multiple threads will be +// calling the management methods, then we can add +// synchronization. For the most part, RT_Task threads should be +// dequeueing commands from the message queue. Only one thread +// should be calling any management methods. +{ + friend ACE_RT_Thread_Manager; +public: + ACE_RT_Task (void); + // Default construction. + + ~ACE_RT_Task (void); + // Deactivates the queue. + + // = Management methods. + + int open_task (const char* name = 0); + // <name> is used to look up our qos info from the scheduler. If + // <name> == 0, then we create a "unique" name and ask the scheduler + // for a new qos structure. If we find an existing qos structure, + // calls this->synch_threads and returns 1. If a qos structure is not + // found, but created returns 0 and does not call synch_threads. + // Returns -1 on failure. + + int try_put (ACE_Message_Block *mb); + // Enqueue a request. Returns 0 on success, -1 on failure. If the + // task is shutdown, -1 is returned with errno == EPIPE. + + int shutdown_task (void); + // If active, shutdown all running thread. Since this is + // accomplished via queued shutdown messages, this has the effect of + // flushing the queue. Once all threads exit, threads_closed will + // be called. If this is a passive object, then the queue will be + // flushed and threads_closed will be called. + + int synch_threads (size_t threads); + // Compare <threads> with what is actually running. If there are + // any differences, update this RT_Task. This may involve spawning + // more threads or changing thread priorities, etc. This can be + // used to close all threads by sending a 0. + + RtecScheduler::handle_t rt_info (void); + // QOS accessor. The behavior of the task can be changed by setting + // this and then calling this->synch_threads. + + virtual void threads_closed (void); + // Called when every thread has exited. This hook allows + // applications to specify semantics when all threads have exited. + // For instance, the Dispatching Module uses this hook to delete + // itself when an application is shutting down. + + virtual int svc_hook (RtecScheduler::OS_Priority priority); + // This is called the first time the thread is spawned. <priority> + // is the priority of the current thread. If this returns != 1 + // (e.g., 0), the event loop will execute (calling this->svc_one). + // If this returns 1, the event loop will not execute. + + virtual int svc_one (void); + // Call this->getq once and execute the command. Returns the result + // of command->execute (). + +protected: + RtecScheduler::handle_t rt_info_; + // Scheduling characteristics of this active object. + + int closed_; + // Set to 1 when this->shutdown_threads or this->close_queue is + // called. Keeps us from enqueuing more that one shutdown message. + + virtual int svc (void); + // Run by each thread spawned. Each thread dequeues + // ACE_RT_Task_Commands and executes them. + + virtual int close (u_long flags = 0); + // Called each time a thread exits. + + void close_all_threads (void); + // Enqueues shutdown message for every thread in the task. +}; + +#if defined (__ACE_INLINE__) +#include "RT_Task.i" +#endif /* __ACE_INLINE__ */ + +#endif /* ACE_RT_TASK_H */ diff --git a/TAO/orbsvcs/Event_Service/RT_Task.i b/TAO/orbsvcs/Event_Service/RT_Task.i new file mode 100644 index 00000000000..b6b21d50494 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/RT_Task.i @@ -0,0 +1,8 @@ +/* -*- C++ -*- */ +// $Id$ + +ACE_INLINE RtecScheduler::handle_t +ACE_RT_Task::rt_info (void) +{ + return rt_info_; +} diff --git a/TAO/orbsvcs/Event_Service/ReactorTask.cpp b/TAO/orbsvcs/Event_Service/ReactorTask.cpp new file mode 100644 index 00000000000..00e2121846d --- /dev/null +++ b/TAO/orbsvcs/Event_Service/ReactorTask.cpp @@ -0,0 +1,110 @@ +// +// $Id$ +// +#include "ace/High_Res_Timer.h" +#include "tao/Timeprobe.h" +#include "orbsvcs/Scheduler_Factory.h" + +#include "ReactorTask.h" + +ACE_ES_Reactor_Task::ACE_ES_Reactor_Task() : + // reactor_ (0, &timer_queue_), + done_ (0) +{ + // Change the timer mechanism used by the reactor and the timer + // queue. +#if defined (VXWORKS) + timer_queue_.gettimeofday (ACE_OS::gettimeofday); +#else + timer_queue_.gettimeofday (ACE_High_Res_Timer::gettimeofday); +#endif /* VXWORKS */ +} + +ACE_ES_Reactor_Task::~ACE_ES_Reactor_Task (void) +{ +} + +int +ACE_ES_Reactor_Task::svc_hook(RtecScheduler::OS_Priority) +{ + // Make ourselves owner of the reactor. + reactor_.owner (ACE_Thread::self()); + return 0; +} + +int +ACE_ES_Reactor_Task::open_reactor (RtecScheduler::Period &period) +{ + // Create a name for ourself using the priority. + char temp[64]; + ACE_OS::sprintf (temp, "Reactor_Task-%u", period); + + // Open the task. This will query the scheduler for our qos + // structure. + int result = this->open_task (temp); + + switch (result) + { + case -1: + // Error. + ACE_ERROR ((LM_ERROR, "(%t) Scheduler could not find operation %s.\n", + temp)); + return -1; + + case 0: + // @@ TODO handle exceptions + { + ACE_TRY + { + ACE_Scheduler_Factory::server()->set(rt_info_, + 0, 0, 0, period, + RtecScheduler::VERY_LOW, + RtecScheduler::NO_QUANTUM, + 1, ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, "set failed\n"), -1); + } + ACE_ENDTRY; + } + break; + + case 1: + // Found. + break; + } + + return this->synch_threads (1); +} + +int ACE_ES_Reactor_Task::svc_one() +{ + ACE_TIMEPROBE (" Reactor_Task - waiting for events"); + if (reactor_.handle_events() == -1) + ACE_ERROR ((LM_ERROR, "(%t) %p.\n", "ACE_ES_Reactor_Task::svc")); + ACE_TIMEPROBE (" Reactor_Task - events handled"); + + if (done_) + ACE_DEBUG ((LM_DEBUG, "(%t) Timer Task is done.\n")); + + return done_; +} + +void ACE_ES_Reactor_Task::threads_closed() +{ + delete this; +} + +void ACE_ES_Reactor_Task::shutdown_task() +{ + done_ = 1; + reactor_.notify(); +} + +ACE_ES_Reactor_Task::Reactor& +ACE_ES_Reactor_Task::get_reactor() +{ + return reactor_; +} diff --git a/TAO/orbsvcs/Event_Service/ReactorTask.h b/TAO/orbsvcs/Event_Service/ReactorTask.h new file mode 100644 index 00000000000..973d6f82f97 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/ReactorTask.h @@ -0,0 +1,76 @@ +// $Id$ + +#if !defined ACE_ReactorTask_H +#define ACE_ReactorTask_H + +// BBM, moved this here from UPSingleProcessorOrb.h +//## begin module.includes preserve=yes +#include "Fast_Reactor.h" +#if defined (ACE_OLD_STYLE_REACTOR) +# define ACE_ORB_REACTOR ACE_ES_Fast_Reactor +#endif /* ACE_OLD_STYLE_REACTOR */ +//## end module.includes + +// Added these. +#include "ace/Timer_Heap.h" +#include "ace/Timer_List.h" + +#include "Local_ESTypes.h" +#include "RT_Task.h" + +class ACE_ES_Reactor_Task : public ACE_RT_Task +// = TITLE +// Event Service Timer Task +// +// = DESCRIPTION +// An active object that dispatches timers from its own ReactorEx. +{ +public: + // BBM, added this. +#if defined (ACE_OLD_STYLE_REACTOR) + typedef ACE_ORB_REACTOR Reactor; +#else + typedef ACE_Reactor Reactor; +#endif /* ACE_OLD_STYLE_REACTOR */ + + ACE_ES_Reactor_Task(); + // Default construction. + + ~ACE_ES_Reactor_Task(); + // Destruction. + + virtual int svc_hook(RtecScheduler::OS_Priority); + // Assume ownership of the reactor_. + + int open_reactor (RtecScheduler::Period &period); + // This is a hack for now. + + virtual int svc_one(); + // Calls reactor_.handle_events until done_ is set. + + void shutdown_task(); + // Sets done_ and notifies the reactor_. + + Reactor &get_reactor(); + // ReactorEx accessor. + + virtual void threads_closed(); + // Deletes this. + +private: + ACE_Timer_List timer_queue_; + // The timer storage mechanism used by reactor_. + +#if !defined (ACE_OLD_STYLE_REACTOR) + ACE_ES_Fast_Reactor fast_reactor_; + // The timer dispatch mechanism. +#endif /* ! ACE_OLD_STYLE_REACTOR */ + + Reactor reactor_; + // "Public" handle to fast_reactor_. + + sig_atomic_t done_; + // When set, end the event loop. +}; + +#endif /* ACE_ReactorTask_H */ diff --git a/TAO/orbsvcs/Event_Service/Task_Manager.cpp b/TAO/orbsvcs/Event_Service/Task_Manager.cpp new file mode 100644 index 00000000000..e90ee3682da --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Task_Manager.cpp @@ -0,0 +1,37 @@ +// $Id$ + +#include "Task_Manager.h" +#include "ReactorTask.h" + +#if ! defined (__ACE_INLINE__) +#include "Task_Manager.i" +#endif /* __ACE_INLINE__ */ + +ACE_Task_Manager::ACE_Task_Manager() +{ + for (int x=0; x < ACE_Scheduler_MAX_PRIORITIES; x++) + { + reactorTasks[x] = 0; + } +} + +void ACE_Task_Manager::initialize() +{ + for (int x=0; x < ACE_Scheduler_MAX_PRIORITIES; x++) + { + RtecScheduler::Period tv = ACE_Scheduler_Rates[x]; + reactorTasks[x] = new ReactorTask; + if (reactorTasks[x] == 0 || + reactorTasks[x]->open_reactor (tv) == -1) + { + ACE_ERROR ((LM_ERROR, "%p.\n", "ACE_ORB::initialize_reactors")); + return; + } + } +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Singleton<ACE_Task_Manager,ACE_SYNCH_MUTEX>; +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate class ACE_Singleton<ACE_Task_Manager,ACE_SYNCH_MUTEX> +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ diff --git a/TAO/orbsvcs/Event_Service/Task_Manager.h b/TAO/orbsvcs/Event_Service/Task_Manager.h new file mode 100644 index 00000000000..8fbd96478d1 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Task_Manager.h @@ -0,0 +1,56 @@ +/* -*- C++ -*- */ +// +// $Id$ +// + +#if !defined(TASK_MANAGER_H) +#define TASK_MANAGER_H + +#include "ace/ACE.h" +#include "ace/Singleton.h" +#include "orbsvcs/Event_Service_Constants.h" +#include "RT_Task.h" + +class ACE_ES_Reactor_Task; + +class ACE_Task_Manager +// = TITLE +// Singleton class for the pool of ACE_ReactorTask. +// +// = DESCRIPTION +// The EventChannel uses a pool of ACE_ReactorTask to handle the +// dispatching of Events. In real-time multi-threaded enviroments +// this maps to a different thread per priority. +// This class offers a centralized access point to those tasks and +// some related services. +// +{ +public: + typedef ACE_ES_Reactor_Task ReactorTask; + + static ACE_Task_Manager* instance(); + // Returns the singleton. + + ReactorTask* GetReactorTask(RtecScheduler::OS_Priority priority); + // Obtain the ReactorTask for the given priority. + // The Task must have been created already. + + ACE_RT_Thread_Manager* ThrMgr(); + // Returns a global ThreadManager for the Task pool. + +private: + friend class ACE_Singleton<ACE_Task_Manager,ACE_SYNCH_MUTEX>; + ACE_Task_Manager(); + + void initialize(); + +private: + ReactorTask *reactorTasks[ACE_Scheduler_MAX_PRIORITIES]; + ACE_RT_Thread_Manager thr_mgr; +}; + +#if defined (__ACE_INLINE__) +#include "Task_Manager.i" +#endif /* __ACE_INLINE__ */ + +#endif /* TASK_MANAGER_H */ diff --git a/TAO/orbsvcs/Event_Service/Task_Manager.i b/TAO/orbsvcs/Event_Service/Task_Manager.i new file mode 100644 index 00000000000..35abcc0268c --- /dev/null +++ b/TAO/orbsvcs/Event_Service/Task_Manager.i @@ -0,0 +1,30 @@ +// +// $Id$ +// + +ACE_INLINE ACE_Task_Manager::ReactorTask* +ACE_Task_Manager::GetReactorTask(RtecScheduler::OS_Priority priority) +{ + if (reactorTasks[priority] == 0) + { + initialize(); + //ACE_ERROR_RETURN ((LM_ERROR, + //"%p no reactor task for priority %d.\n", + //"ACE_Task_Manager::GetReactor", + //priority), 0); + } + + return reactorTasks[priority]; +} + +ACE_INLINE ACE_RT_Thread_Manager* ACE_Task_Manager::ThrMgr() +{ + return &thr_mgr; +} + +ACE_INLINE ACE_Task_Manager* ACE_Task_Manager::instance() +{ + return ACE_Singleton<ACE_Task_Manager,ACE_SYNCH_MUTEX>::instance(); +} + + diff --git a/TAO/orbsvcs/Event_Service/svc.conf b/TAO/orbsvcs/Event_Service/svc.conf new file mode 100644 index 00000000000..43c6a486c92 --- /dev/null +++ b/TAO/orbsvcs/Event_Service/svc.conf @@ -0,0 +1,49 @@ +# $Id$ +# +# This file contains a sample ACE_Service_Config configuration +# file specifying the strategy factories utilized by an application +# using TAO. There are currently only two possible factories: +# Client_Strategy_Factory and Server_Strategy_Factory. These names +# must be used as the second argument to their corresponding line, +# because that's what the ORB uses to find the desired factory. +# +# Note that there are two unordinary characteristics of the way *this* +# file is set up: +# - both client and server strategies are specified in the same +# file, which would only make sense for co-located clients & servers +# - both of the factories are actually sourced out of libTAO.so +# (TAO.DLL on Win32), and they would normally be in a separate +# dll from the TAO ORB Core. +# +# The options which can be passed to the Resource Factory are: +# +# -ORBresources <which> +# where <which> can be 'global' to specify globally-held resources, +# or 'tss' to specify thread-specific resources. +# +# The options which can be passed to the Client are: +# <none currently> +# +# The options which can be passed to the Server are: +# +# -ORBconcurrency <which> +# where <which> can be 'thread-per-connection' to specify +# use of the ACE_Threaded_Strategy concurrency strategy, +# or 'reactive' to specify use of the ACE_Reactive_Strategy +# concurrency strategy. +# +# -ORBthreadflags <flags> +# specifies the default thread flags to use, where <flags> is a +# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, +# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid +# on every platform. +# +# -ORBdemuxstrategy <which> +# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', +# and specifies the type of object lookup strategy used internally. +# -ORBtablesize <unsigned> +# specifies the size of the object table +# +dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources global" +dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() +dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128" diff --git a/TAO/orbsvcs/Makefile b/TAO/orbsvcs/Makefile index b7b989aa0f4..1f4bb7b8d64 100644 --- a/TAO/orbsvcs/Makefile +++ b/TAO/orbsvcs/Makefile @@ -8,9 +8,12 @@ # Local macros #---------------------------------------------------------------------------- -DIRS = lib \ - bin \ - tests +DIRS = orbsvcs \ + Naming_Service \ + Scheduling_Service \ + Event_Service \ + Dump_Schedule \ + tests \ #---------------------------------------------------------------------------- # Include macros and targets diff --git a/TAO/orbsvcs/bin/Naming_Service/CosNaming_i.cpp b/TAO/orbsvcs/Naming_Service/CosNaming_i.cpp index e9c1fb645d4..e9c1fb645d4 100644 --- a/TAO/orbsvcs/bin/Naming_Service/CosNaming_i.cpp +++ b/TAO/orbsvcs/Naming_Service/CosNaming_i.cpp diff --git a/TAO/orbsvcs/bin/Naming_Service/CosNaming_i.h b/TAO/orbsvcs/Naming_Service/CosNaming_i.h index 6d00ce8f39f..9769a2cc7f5 100644 --- a/TAO/orbsvcs/bin/Naming_Service/CosNaming_i.h +++ b/TAO/orbsvcs/Naming_Service/CosNaming_i.h @@ -18,7 +18,7 @@ #if !defined (COSNAMING_I_H) #define COSNAMING_I_H -#include "CosNamingS.h" +#include "orbsvcs/CosNamingS.h" #include "NS_CosNaming.h" class NS_NamingContext : public POA_CosNaming::NamingContext diff --git a/TAO/orbsvcs/bin/Naming_Service/Makefile b/TAO/orbsvcs/Naming_Service/Makefile index e764ca2c4e4..242ed3bb102 100644 --- a/TAO/orbsvcs/bin/Naming_Service/Makefile +++ b/TAO/orbsvcs/Naming_Service/Makefile @@ -8,15 +8,15 @@ # Local macros #---------------------------------------------------------------------------- -SVR_SRCS=NS_CosNaming.cpp CosNaming_i.cpp svr.cpp +SVR_SRCS=NS_CosNaming.cpp CosNaming_i.cpp Naming_Service.cpp LSRC = $(SVR_SRCS) SVR_OBJS = $(SVR_SRCS:.cpp=.o) -BIN = svr +BIN = Naming_Service BUILD = $(BIN) -LDLIBS = -lorbsvcs -lTAO +LDLIBS = -lorbsvcs -lTAO VLDLIBS = $(LDLIBS:%=%$(VAR)) #---------------------------------------------------------------------------- @@ -35,15 +35,10 @@ TAO_ROOT = $(ACE_ROOT)/TAO endif TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE DCFLAGS = -g -LDFLAGS += -L$(TAO_ROOT)/orbsvcs/lib -L$(TAO_ROOT)/tao -CPPFLAGS += -I$(TAO_ROOT)/orbsvcs/lib -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H +LDFLAGS += -L$(TAO_ROOT)/orbsvcs/orbsvcs -L$(TAO_ROOT)/tao +CPPFLAGS += -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H -#$(IDL_SRC): CosNaming.idl logger.idl -# $(TAO_ROOT)/TAO_IDL/tao_idl CosNaming.idl -# $(TAO_ROOT)/TAO_IDL/tao_idl logger.idl -# - -svr: $(addprefix $(VDIR),$(SVR_OBJS)) +Naming_Service: $(addprefix $(VDIR),$(SVR_OBJS)) $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) # DO NOT DELETE THIS LINE -- g++dep uses it. @@ -157,6 +152,8 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -166,7 +163,6 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(TAO_ROOT)/tao/varout.h \ $(TAO_ROOT)/tao/any.h \ $(TAO_ROOT)/tao/poa.h \ - $(TAO_ROOT)/tao/tao_internals.h \ $(TAO_ROOT)/tao/params.h \ $(TAO_ROOT)/tao/client_factory.h \ $(TAO_ROOT)/tao/server_factory.h \ @@ -187,6 +183,7 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(TAO_ROOT)/tao/objtable.h \ $(TAO_ROOT)/tao/optable.h \ $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ $(TAO_ROOT)/tao/iiopobj.h \ $(TAO_ROOT)/tao/iioporb.h \ $(TAO_ROOT)/tao/giop.h \ @@ -196,26 +193,27 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(TAO_ROOT)/tao/sequence.i \ $(TAO_ROOT)/tao/typecode.i \ $(TAO_ROOT)/tao/any.i \ - $(TAO_ROOT)/tao/cdr.i \ $(TAO_ROOT)/tao/stub.i \ $(TAO_ROOT)/tao/object.i \ $(TAO_ROOT)/tao/orbobj.i \ $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ $(TAO_ROOT)/tao/poa.i \ $(TAO_ROOT)/tao/giop.i \ $(TAO_ROOT)/tao/iioporb.i \ $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ $(TAO_ROOT)/tao/params.i \ $(TAO_ROOT)/tao/server_factory.i \ $(TAO_ROOT)/tao/default_client.i \ $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.i + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i .obj/CosNaming_i.o .shobj/CosNaming_i.: CosNaming_i.cpp CosNaming_i.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingS.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ @@ -323,6 +321,8 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -332,7 +332,6 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(TAO_ROOT)/tao/varout.h \ $(TAO_ROOT)/tao/any.h \ $(TAO_ROOT)/tao/poa.h \ - $(TAO_ROOT)/tao/tao_internals.h \ $(TAO_ROOT)/tao/params.h \ $(TAO_ROOT)/tao/client_factory.h \ $(TAO_ROOT)/tao/server_factory.h \ @@ -353,6 +352,7 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(TAO_ROOT)/tao/objtable.h \ $(TAO_ROOT)/tao/optable.h \ $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ $(TAO_ROOT)/tao/iiopobj.h \ $(TAO_ROOT)/tao/iioporb.h \ $(TAO_ROOT)/tao/giop.h \ @@ -362,27 +362,28 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(TAO_ROOT)/tao/sequence.i \ $(TAO_ROOT)/tao/typecode.i \ $(TAO_ROOT)/tao/any.i \ - $(TAO_ROOT)/tao/cdr.i \ $(TAO_ROOT)/tao/stub.i \ $(TAO_ROOT)/tao/object.i \ $(TAO_ROOT)/tao/orbobj.i \ $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ $(TAO_ROOT)/tao/poa.i \ $(TAO_ROOT)/tao/giop.i \ $(TAO_ROOT)/tao/iioporb.i \ $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ $(TAO_ROOT)/tao/params.i \ $(TAO_ROOT)/tao/server_factory.i \ $(TAO_ROOT)/tao/default_client.i \ $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.i \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.i \ NS_CosNaming.h -.obj/svr.o .shobj/svr.: svr.cpp CosNaming_i.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingS.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.h \ +.obj/Naming_Service.o .shobj/Naming_Service.: Naming_Service.cpp CosNaming_i.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ @@ -490,6 +491,8 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -499,7 +502,6 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(TAO_ROOT)/tao/varout.h \ $(TAO_ROOT)/tao/any.h \ $(TAO_ROOT)/tao/poa.h \ - $(TAO_ROOT)/tao/tao_internals.h \ $(TAO_ROOT)/tao/params.h \ $(TAO_ROOT)/tao/client_factory.h \ $(TAO_ROOT)/tao/server_factory.h \ @@ -520,6 +522,7 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(TAO_ROOT)/tao/objtable.h \ $(TAO_ROOT)/tao/optable.h \ $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ $(TAO_ROOT)/tao/iiopobj.h \ $(TAO_ROOT)/tao/iioporb.h \ $(TAO_ROOT)/tao/giop.h \ @@ -529,23 +532,28 @@ svr: $(addprefix $(VDIR),$(SVR_OBJS)) $(TAO_ROOT)/tao/sequence.i \ $(TAO_ROOT)/tao/typecode.i \ $(TAO_ROOT)/tao/any.i \ - $(TAO_ROOT)/tao/cdr.i \ $(TAO_ROOT)/tao/stub.i \ $(TAO_ROOT)/tao/object.i \ $(TAO_ROOT)/tao/orbobj.i \ $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ $(TAO_ROOT)/tao/poa.i \ $(TAO_ROOT)/tao/giop.i \ $(TAO_ROOT)/tao/iioporb.i \ $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ $(TAO_ROOT)/tao/params.i \ $(TAO_ROOT)/tao/server_factory.i \ $(TAO_ROOT)/tao/default_client.i \ $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.i \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingS.i \ - NS_CosNaming.h + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingS.i \ + NS_CosNaming.h Naming_Service.h \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.h \ + $(ACE_ROOT)/ace/SOCK_Dgram.i \ + $(ACE_ROOT)/ace/SOCK_Dgram_Mcast.i # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/bin/Naming_Service/NS_CosNaming.cpp b/TAO/orbsvcs/Naming_Service/NS_CosNaming.cpp index ee1843581db..ee1843581db 100644 --- a/TAO/orbsvcs/bin/Naming_Service/NS_CosNaming.cpp +++ b/TAO/orbsvcs/Naming_Service/NS_CosNaming.cpp diff --git a/TAO/orbsvcs/bin/Naming_Service/NS_CosNaming.h b/TAO/orbsvcs/Naming_Service/NS_CosNaming.h index f897f23d2ca..c6bd0e59771 100644 --- a/TAO/orbsvcs/bin/Naming_Service/NS_CosNaming.h +++ b/TAO/orbsvcs/Naming_Service/NS_CosNaming.h @@ -21,7 +21,7 @@ #include "ace/SString.h" #include "tao/corba.h" -#include "CosNamingC.h" +#include "orbsvcs/CosNamingC.h" class NS_IntId // = TITLE diff --git a/TAO/orbsvcs/bin/Naming_Service/svr.cpp b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp index d335aa074c5..77eb4544334 100644 --- a/TAO/orbsvcs/bin/Naming_Service/svr.cpp +++ b/TAO/orbsvcs/Naming_Service/Naming_Service.cpp @@ -2,8 +2,9 @@ // $Id$ // #include <iostream.h> + #include "CosNaming_i.h" -#include "svr.h" +#include "Naming_Service.h" // This is a startup for the naming server. // This is used for testing of the Naming Service. diff --git a/TAO/orbsvcs/bin/Naming_Service/svr.h b/TAO/orbsvcs/Naming_Service/Naming_Service.h index 988145b53c8..2284e2ae7e4 100644 --- a/TAO/orbsvcs/bin/Naming_Service/svr.h +++ b/TAO/orbsvcs/Naming_Service/Naming_Service.h @@ -18,8 +18,8 @@ // // ============================================================================ -#if !defined (SVR_H) -#define SVR_H +#if !defined (NAMING_SERVICE_H) +#define NAMING_SERVICE_H #include "ace/INET_Addr.h" #include "ace/SOCK_Dgram_Mcast.h" @@ -69,4 +69,4 @@ private: // socket for response to the multicast }; -#endif /* SVR_H */ +#endif /* NAMING_SERVICE_H */ diff --git a/TAO/orbsvcs/Naming_Service/svc.conf b/TAO/orbsvcs/Naming_Service/svc.conf new file mode 100644 index 00000000000..43c6a486c92 --- /dev/null +++ b/TAO/orbsvcs/Naming_Service/svc.conf @@ -0,0 +1,49 @@ +# $Id$ +# +# This file contains a sample ACE_Service_Config configuration +# file specifying the strategy factories utilized by an application +# using TAO. There are currently only two possible factories: +# Client_Strategy_Factory and Server_Strategy_Factory. These names +# must be used as the second argument to their corresponding line, +# because that's what the ORB uses to find the desired factory. +# +# Note that there are two unordinary characteristics of the way *this* +# file is set up: +# - both client and server strategies are specified in the same +# file, which would only make sense for co-located clients & servers +# - both of the factories are actually sourced out of libTAO.so +# (TAO.DLL on Win32), and they would normally be in a separate +# dll from the TAO ORB Core. +# +# The options which can be passed to the Resource Factory are: +# +# -ORBresources <which> +# where <which> can be 'global' to specify globally-held resources, +# or 'tss' to specify thread-specific resources. +# +# The options which can be passed to the Client are: +# <none currently> +# +# The options which can be passed to the Server are: +# +# -ORBconcurrency <which> +# where <which> can be 'thread-per-connection' to specify +# use of the ACE_Threaded_Strategy concurrency strategy, +# or 'reactive' to specify use of the ACE_Reactive_Strategy +# concurrency strategy. +# +# -ORBthreadflags <flags> +# specifies the default thread flags to use, where <flags> is a +# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, +# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid +# on every platform. +# +# -ORBdemuxstrategy <which> +# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', +# and specifies the type of object lookup strategy used internally. +# -ORBtablesize <unsigned> +# specifies the size of the object table +# +dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources global" +dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() +dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128" diff --git a/TAO/orbsvcs/Scheduling_Service/Config_Scheduler.cpp b/TAO/orbsvcs/Scheduling_Service/Config_Scheduler.cpp new file mode 100644 index 00000000000..3713abfc7d9 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Config_Scheduler.cpp @@ -0,0 +1,261 @@ +// ============================================================================ +// +// $Id$ +// +// ============================================================================ + +#include "orbsvcs/Scheduler_Factory.h" + +#include "Scheduler_Generic.h" +#include "Config_Scheduler.h" + +#if defined (__ACE_INLINE__) +#include "Config_Scheduler.i" +#endif /* __ACE_INLINE__ */ + +ACE_Config_Scheduler::ACE_Config_Scheduler (void) + : POA_RtecScheduler::Scheduler ("Scheduler_Generic"), + impl(new Scheduler_Generic) +{ + impl->output_level (10); +} + +ACE_Config_Scheduler::~ACE_Config_Scheduler (void) +{ + delete impl; +} + +RtecScheduler::handle_t +ACE_Config_Scheduler::create (const char * entry_point, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, + RtecScheduler::DUPLICATE_NAME)) +{ + typedef RtecScheduler::RT_Info* RT_Info_ptr; + + RtecScheduler::RT_Info** rt_info; + ACE_NEW_RETURN (rt_info, RT_Info_ptr[1], -1); + + ACE_NEW_RETURN (rt_info[0], RtecScheduler::RT_Info, -1); + + rt_info[0]->entry_point = CORBA::string_dup(entry_point); + rt_info[0]->handle = -1; + rt_info[0]->worst_case_execution_time = 0; + rt_info[0]->typical_execution_time = 0; + rt_info[0]->cached_execution_time = 0; + rt_info[0]->period = 0; + rt_info[0]->importance = RtecScheduler::VERY_LOW; + rt_info[0]->quantum = RtecScheduler::NO_QUANTUM; + rt_info[0]->threads = 0; + rt_info[0]->priority = 0; + rt_info[0]->subpriority = 0; + rt_info[0]->preemption_priority = 0; + + RtecScheduler::handle_t handle = -1; + switch (impl->register_task (rt_info, 1, handle)) + { + case ACE_Scheduler::SUCCEEDED: + break; + case ACE_Scheduler::ST_VIRTUAL_MEMORY_EXHAUSTED: + case ACE_Scheduler::ST_TASK_ALREADY_REGISTERED: + default: + delete rt_info[0]; + delete[] rt_info; + ACE_ERROR ((LM_ERROR, + "Config_Scheduler::create - register_task failed\n")); + // TODO: throw something. + break; + } + return handle; +} + +RtecScheduler::handle_t +ACE_Config_Scheduler::lookup (const char * entry_point, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException)) +{ + RtecScheduler::RT_Info* rt_info = 0; + switch (impl->get_rt_info (entry_point, rt_info)) + { + case ACE_Scheduler::SUCCEEDED: + return rt_info->handle; + break; + case ACE_Scheduler::FAILED: + case ACE_Scheduler::ST_UNKNOWN_TASK: + default: + ACE_ERROR ((LM_ERROR, + "Config_Scheduler::lookup - get_rt_info failed\n")); + // TODO: throw something. + break; + } + return -1; +} + +RtecScheduler::RT_Info* +ACE_Config_Scheduler::get (RtecScheduler::handle_t handle, + CORBA::Environment &_env) + ACE_THROW_SPEC((CORBA::SystemException, + RtecScheduler::UNKNOWN_TASK)) +{ + RtecScheduler::RT_Info* rt_info = 0; + switch (impl->lookup_rt_info (handle, rt_info)) + { + case ACE_Scheduler::SUCCEEDED: + { + // IDL memory managment semantics require the we return a copy + RtecScheduler::RT_Info* copy; + ACE_NEW_RETURN (copy, RtecScheduler::RT_Info (*rt_info), 0); + return copy; + } + break; + case ACE_Scheduler::FAILED: + case ACE_Scheduler::ST_UNKNOWN_TASK: + default: + ACE_ERROR ((LM_ERROR, + "Config_Scheduler::get - lookup_rt_info failed\n")); + // TODO: throw something. + break; + } + return 0; +} + +void ACE_Config_Scheduler::set (RtecScheduler::handle_t handle, + RtecScheduler::Time time, + RtecScheduler::Time typical_time, + RtecScheduler::Time cached_time, + RtecScheduler::Period period, + RtecScheduler::Importance importance, + RtecScheduler::Quantum quantum, + CORBA::Long threads, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, + RtecScheduler::UNKNOWN_TASK)) +{ + RtecScheduler::RT_Info* rt_info = 0; + switch (impl->lookup_rt_info (handle, rt_info)) + { + case ACE_Scheduler::SUCCEEDED: + rt_info->worst_case_execution_time = time; + rt_info->typical_execution_time = typical_time; + rt_info->cached_execution_time = cached_time; + rt_info->period = period; + rt_info->importance = importance; + rt_info->quantum = quantum; + rt_info->threads = threads; + break; + case ACE_Scheduler::FAILED: + case ACE_Scheduler::ST_UNKNOWN_TASK: + default: + ACE_ERROR ((LM_ERROR, + "Config_Scheduler::set - lookup_rt_info failed\n")); + // TODO: throw something. + break; + } +} + +void ACE_Config_Scheduler::priority (RtecScheduler::handle_t handle, + RtecScheduler::OS_Priority& priority, + RtecScheduler::Sub_Priority& subpriority, + RtecScheduler::Preemption_Priority& p_priority, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, + RtecScheduler::UNKNOWN_TASK, + RtecScheduler::NOT_SCHEDULED)) +{ + if (impl->priority (handle, priority, subpriority, p_priority) == -1) + { + ACE_ERROR ((LM_ERROR, + "Config_Scheduler::priority - priority failed\n")); + // TODO: throw something. + } +} + +void ACE_Config_Scheduler::entry_point_priority (const char * entry_point, + RtecScheduler::OS_Priority& priority, + RtecScheduler::Sub_Priority& subpriority, + RtecScheduler::Preemption_Priority& p_priority, + CORBA::Environment &_env) + ACE_THROW_SPEC((CORBA::SystemException, + RtecScheduler::UNKNOWN_TASK, + RtecScheduler::NOT_SCHEDULED)) +{ + this->priority (lookup (entry_point, _env), + priority, subpriority, p_priority, + _env); +} + +void ACE_Config_Scheduler::add_dependency (RtecScheduler::handle_t handle, + RtecScheduler::handle_t dependency, + CORBA::Long number_of_calls, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, + RtecScheduler::UNKNOWN_TASK)) +{ + RtecScheduler::RT_Info* rt_info = 0; + switch (impl->lookup_rt_info (handle, rt_info)) + { + case ACE_Scheduler::SUCCEEDED: + { + RtecScheduler::Dependency_Info dep; + dep.rt_info = dependency; + dep.number_of_calls = number_of_calls; + ACE_Scheduler::add_dependency(rt_info, dep); + } + break; + case ACE_Scheduler::FAILED: + case ACE_Scheduler::ST_UNKNOWN_TASK: + default: + ACE_ERROR ((LM_ERROR, + "cannot find %d to add dependency", handle)); + // TODO: throw something. + break; + } +} + +void ACE_Config_Scheduler::compute_scheduling (CORBA::Long minimum_priority, + CORBA::Long maximum_priority, + RtecScheduler::RT_Info_Set_out infos, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, + RtecScheduler::UTILIZATION_BOUND_EXCEEDED, + RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS, + RtecScheduler::TASK_COUNT_MISMATCH)) +{ + impl->init (minimum_priority, maximum_priority); + if (impl->schedule () != ACE_Scheduler::SUCCEEDED) + { + // TODO: throw something. + ACE_ERROR ((LM_ERROR, "schedule failed\n")); + return; + } + if (infos == 0) + { + infos = new RtecScheduler::RT_Info_Set(impl->tasks ()); + } + infos->length (impl->tasks ()); + for (RtecScheduler::handle_t handle = 1; + handle <= impl->tasks (); + ++handle) + { + RtecScheduler::RT_Info* rt_info = 0; + switch (impl->lookup_rt_info (handle, rt_info)) + { + case ACE_Scheduler::SUCCEEDED: + // We know that handles start at 1. + infos[CORBA::ULong(handle - 1)] = *rt_info; + break; + case ACE_Scheduler::FAILED: + case ACE_Scheduler::ST_UNKNOWN_TASK: + default: + ACE_ERROR ((LM_ERROR, + "Config_Scheduler::schedule - lookup_rt_info failed\n")); + // TODO: throw something. + break; + } + } + ACE_DEBUG ((LM_DEBUG, "schedule prepared\n")); + + ACE_DEBUG ((LM_DEBUG, "dumping to stdout\n")); + ACE_Scheduler_Factory::dump_schedule (*infos, 0); + ACE_DEBUG ((LM_DEBUG, "dump done\n")); +} diff --git a/TAO/orbsvcs/Scheduling_Service/Config_Scheduler.h b/TAO/orbsvcs/Scheduling_Service/Config_Scheduler.h new file mode 100644 index 00000000000..6fc922bb1d7 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Config_Scheduler.h @@ -0,0 +1,94 @@ +// ============================================================================ +// +// $Id$ +// +// ============================================================================ + +#ifndef ACE_CONFIG_SCHEDULER_H +#define ACE_CONFIG_SCHEDULER_H + +#include "ace/OS.h" + +#include "orbsvcs/RtecSchedulerS.h" +#include "orbsvcs/Event_Service_Constants.h" + +class ACE_Config_Scheduler +: public POA_RtecScheduler::Scheduler + // = TITLE + // A (local) implementation for the RtecScheduler::Scheduler service. + // + // = DESCRIPTION + // This class implements a servant for the + // RtecScheduler::Scheduler service, using the Scheduler classes + // distributed with the EC. +{ +public: + ACE_Config_Scheduler (void); + virtual ~ACE_Config_Scheduler (void); + + virtual RtecScheduler::handle_t create (const char * entry_point, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, RtecScheduler::DUPLICATE_NAME)); + + virtual RtecScheduler::handle_t lookup (const char * entry_point, + CORBA::Environment &_env) + ACE_THROW_SPEC((CORBA::SystemException)); + + virtual RtecScheduler::RT_Info* get (RtecScheduler::handle_t handle, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, RtecScheduler::UNKNOWN_TASK)); + + virtual void set (RtecScheduler::handle_t handle, + RtecScheduler::Time time, + RtecScheduler::Time typical_time, + RtecScheduler::Time cached_time, + RtecScheduler::Period period, + RtecScheduler::Importance importance, + RtecScheduler::Quantum quantum, + CORBA::Long threads, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, RtecScheduler::UNKNOWN_TASK)); + + virtual void priority (RtecScheduler::handle_t handle, + RtecScheduler::OS_Priority& priority, + RtecScheduler::Sub_Priority& subpriority, + RtecScheduler::Preemption_Priority& p_priority, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, + RtecScheduler::UNKNOWN_TASK, + RtecScheduler::NOT_SCHEDULED)); + + virtual void entry_point_priority (const char * entry_point, + RtecScheduler::OS_Priority& priority, + RtecScheduler::Sub_Priority& subpriority, + RtecScheduler::Preemption_Priority& p_priority, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, + RtecScheduler::UNKNOWN_TASK, + RtecScheduler::NOT_SCHEDULED)); + + virtual void add_dependency (RtecScheduler::handle_t handle, + RtecScheduler::handle_t dependency, + CORBA::Long number_of_calls, + CORBA::Environment &_env) + ACE_THROW_SPEC ((CORBA::SystemException, + RtecScheduler::UNKNOWN_TASK)); + + virtual void compute_scheduling (CORBA::Long minimum_priority, + CORBA::Long maximum_priority, + RtecScheduler::RT_Info_Set_out infos, + CORBA::Environment &_env) + ACE_THROW_SPEC((CORBA::SystemException, + RtecScheduler::UTILIZATION_BOUND_EXCEEDED, + RtecScheduler::INSUFFICIENT_THREAD_PRIORITY_LEVELS, + RtecScheduler::TASK_COUNT_MISMATCH)); + +private: + class ACE_Scheduler* impl; +}; + +#if defined (__ACE_INLINE__) +#include "Config_Scheduler.i" +#endif /* __ACE_INLINE__ */ + +#endif /* ACE_CONFIG_SCHEDULER_H */ diff --git a/TAO/orbsvcs/lib/Runtime_Scheduler.i b/TAO/orbsvcs/Scheduling_Service/Config_Scheduler.i index a21ea7f9897..a21ea7f9897 100644 --- a/TAO/orbsvcs/lib/Runtime_Scheduler.i +++ b/TAO/orbsvcs/Scheduling_Service/Config_Scheduler.i diff --git a/TAO/orbsvcs/Scheduling_Service/Makefile b/TAO/orbsvcs/Scheduling_Service/Makefile new file mode 100644 index 00000000000..fc9c5d5c380 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Makefile @@ -0,0 +1,746 @@ +# +# $Id$ +# + +BIN = Scheduling_Service +BUILD = $(BIN) + +SCHEDULE_SRCS = \ + Scheduling_Service.cpp \ + Config_Scheduler.cpp \ + Scheduler.cpp \ + Scheduler_Generic.cpp + +LSRC = $(SCHEDULE_SRCS) + +SCHEDULE_OBJS=$(SCHEDULE_SRCS:.cpp=.o) + +LDLIBS = -lorbsvcs -lTAO +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +#include $(ACE_ROOT)/include/makeinclude/rules.bin.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif +TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE +DCFLAGS = -g +LDFLAGS += -L$(TAO_ROOT)/orbsvcs/orbsvcs -L$(TAO_ROOT)/tao +CPPFLAGS += -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H + +Scheduling_Service: $(addprefix $(VDIR),$(SCHEDULE_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +.obj/Scheduling_Service.o .shobj/Scheduling_Service.: Scheduling_Service.cpp \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + Config_Scheduler.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + Config_Scheduler.i +.obj/Config_Scheduler.o .shobj/Config_Scheduler.: Config_Scheduler.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.i \ + Scheduler_Generic.h Scheduler.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + Scheduler.i Scheduler_Generic.i Config_Scheduler.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + Config_Scheduler.i +.obj/Scheduler.o .shobj/Scheduler.: Scheduler.cpp \ + $(ACE_ROOT)/ace/Sched_Params.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Sched_Params.i \ + Scheduler.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + Scheduler.i +.obj/Scheduler_Generic.o .shobj/Scheduler_Generic.: Scheduler_Generic.cpp \ + $(ACE_ROOT)/ace/Sched_Params.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Sched_Params.i \ + Scheduler_Generic.h Scheduler.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + Scheduler.i Scheduler_Generic.i + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduler.cpp b/TAO/orbsvcs/Scheduling_Service/Scheduler.cpp new file mode 100644 index 00000000000..b71e0679469 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Scheduler.cpp @@ -0,0 +1,291 @@ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// sched +// +// = FILENAME +// Scheduler.cpp +// +// = CREATION DATE +// 23 January 1997 +// +// = AUTHOR +// David Levine +// +// ============================================================================ + +#include "ace/Sched_Params.h" +#include "Scheduler.h" + +#if ! defined (__ACE_INLINE__) +#include "Scheduler.i" +#endif /* __ACE_INLINE__ */ + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// class Scheduler static members +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +const ACE_Scheduler::mode_t ACE_Scheduler::CURRENT_MODE = 0xFFFFFFFF; + +ACE_Scheduler *ACE_Scheduler::instance_ = 0; + + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// class ACE_Scheduler static functions +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +void +ACE_Scheduler::output (FILE *file, const status_t status) +{ + switch (status) + { + case NOT_SCHEDULED : + ACE_OS::fprintf (file, "NOT_SCHEDULED"); + break; + case SUCCEEDED : + ACE_OS::fprintf (file, "SUCCEEDED"); + break; + case ST_TASK_ALREADY_REGISTERED : + ACE_OS::fprintf (file, "TASK_ALREADY_REGISTERED"); + break; + case ST_VIRTUAL_MEMORY_EXHAUSTED : + ACE_OS::fprintf (file, "VIRTUAL_MEMORY_EXHAUSTED"); + break; + case ST_UNKNOWN_TASK : + ACE_OS::fprintf (file, "UNKNOWN_TASK"); + break; + case INVALID_MODE : + ACE_OS::fprintf (file, "INVALID_MODE"); + break; + case MODE_COUNT_MISMATCH : + ACE_OS::fprintf (file, "MODE_COUNT_MISMATCH"); + break; + case TASK_COUNT_MISMATCH : + ACE_OS::fprintf (file, "TASK_COUNT_MISMATCH"); + break; + case INVALID_PRIORITY : + ACE_OS::fprintf (file, "INVALID_PRIORITY"); + break; + + // The following are only used during scheduling (in the case of + // off-line scheduling, they are only used prior to runtime). + // To save a little code space (280 bytes on g++ 2.7.2/Solaris 2.5.1), + // we could conditionally compile them so that they're not in the + // runtime version. + case ST_UTILIZATION_BOUND_EXCEEDED : + ACE_OS::fprintf (file, "UTILIZATION_BOUND_EXCEEDED"); + break; + case ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS : + ACE_OS::fprintf (file, "INSUFFICIENT_THREAD_PRIORITY_LEVELS"); + break; + case ST_CYCLE_IN_DEPENDENCIES : + ACE_OS::fprintf (file, "CYCLE_IN_DEPENDENCIES"); + break; + case UNABLE_TO_OPEN_SCHEDULE_FILE : + ACE_OS::fprintf (file, "UNABLE_TO_OPEN_SCHEDULE_FILE"); + break; + case UNABLE_TO_WRITE_SCHEDULE_FILE : + ACE_OS::fprintf (file, "UNABLE_TO_WRITE_SCHEDULE_FILE"); + break; + // End of config-only status values. + + default: + ACE_OS::fprintf (file, "UNKNOWN STATUS: %d", status); + } +} + + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// class ACE_Scheduler member functions +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +ACE_Scheduler::ACE_Scheduler () : + minimum_priority_queue_ (0), // Could initialize this to -1, but it's + // unsigned and we don't really need to + // distinguish between no queues and one + // queue. + modes_ (0), + tasks_ (0), + threads_ (0), + mode_ (0), + status_ (NOT_SCHEDULED), + output_level_ (0) +{ +} + + +ACE_Scheduler::~ACE_Scheduler () +{ +} + + +// ************************************************************ + +ACE_Scheduler::status_t +ACE_Scheduler::get_rt_info (Object_Name name, + RT_Info* &rtinfo) +{ + handle_t handle; + + // This makes a copy. We can optimize this with our own string + // class. + ACE_CString lookup (name); + // Search the map for the <name>. If found, return the RT_Info. + RT_Info **info_array = 0; + if (info_collection_.find (lookup, info_array) >= 0) + { + rtinfo = info_array[0]; + // If we find it, return. + return SUCCEEDED; + } + else + // Otherwise, make one, bind it, and register it. + { + rtinfo = new RT_Info; + rtinfo->entry_point = name; + // Create and array (size one) of RT_Info* + info_array = new RT_Info*[1]; + info_array[0] = rtinfo; + // Bind the rtinfo to the name. + if (info_collection_.bind (lookup, info_array) != 0) + { + delete rtinfo; + delete info_array; + rtinfo = 0; + return FAILED; // Error! + } + else + { + // Register the array. + status_t result = this->register_task (info_array, 1, handle); + if (result == SUCCEEDED) + { + rtinfo->handle = handle; + return ST_UNKNOWN_TASK; // Didn't find it, but made one! + } + else + { + rtinfo->handle = 0; + return FAILED; + } + } + } +} + + + +int ACE_Scheduler::number_of_dependencies(RT_Info* rt_info) +{ + return rt_info->dependencies.length(); +} + +int ACE_Scheduler::number_of_dependencies(RT_Info& rt_info) +{ + return rt_info.dependencies.length(); +} + +int ACE_Scheduler::add_dependency(RT_Info* rt_info, + const Dependency_Info& d) +{ + ACE_DEBUG ((LM_DEBUG, "adding dependecy to: %s\n", + (const char*)rt_info->entry_point)); + RtecScheduler::Dependency_Set& set = rt_info->dependencies; + int l = set.length(); + set.length(l + 1); + set[l] = d; + return 0; +} + +void ACE_Scheduler::export(RT_Info* info, FILE* file) +{ + export(*info, file); +} + +void ACE_Scheduler::export(RT_Info& info, FILE* file) +{ + // The divide-by-1 is for ACE_U_LongLong support. + (void) ACE_OS::fprintf (file, + "%s\n%d\n%ld\n%ld\n%ld\n%ld\n%d\n%ld\n%u\n" + "# begin dependencies\n%d\n", + (const char*)info.entry_point, + info.handle, + info.worst_case_execution_time / 1, + info.typical_execution_time / 1, + info.cached_execution_time / 1, + info.period, + info.importance, + info.quantum / 1, + info.threads, + number_of_dependencies(info)); + + for (int i = 0; i < number_of_dependencies(info); ++i) + { + RT_Info tmp; + // TODO: info.dependencies [i].rt_info >>= &tmp; + (void) ACE_OS::fprintf (file, "%s, %d\n", + (const char*)tmp.entry_point, + info.dependencies[i].number_of_calls); + + } + + (void) ACE_OS::fprintf (file, "# end dependencies\n%d\n%d\n\n", + info.priority, + info.subpriority); + + +} + + + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Lock_Adapter<ACE_Null_Mutex>; +template class ACE_Map_Entry<ACE_CString, ACE_Scheduler::RT_Info **>; + +#if defined (ACE_HAS_THREADS) + template class ACE_Lock_Adapter<ACE_RW_Thread_Mutex>; + template class ACE_Lock_Adapter<ACE_Thread_Mutex>; + template class ACE_Map_Manager<ACE_CString, + ACE_Scheduler::RT_Info **, + ACE_Thread_Mutex>; + template class ACE_Map_Iterator<ACE_CString, ACE_Scheduler::RT_Info **, + ACE_Thread_Mutex>; + template class ACE_Read_Guard<ACE_Thread_Mutex>; + template class ACE_Write_Guard<ACE_Thread_Mutex>; +#else + template class ACE_Map_Manager<ACE_CString, RT_Info **, + ACE_Null_Mutex>; + template class ACE_Map_Iterator<ACE_CString, RT_Info **, + ACE_Null_Mutex>; + template class ACE_Read_Guard<ACE_Null_Mutex>; + template class ACE_Write_Guard<ACE_Null_Mutex>; +#endif /* ACE_HAS_THREADS */ +#elif defined(ACE_HAS_TEMPLATE_INSTANTIATION_PRAGMA) +#pragma instantiate class ACE_Lock_Adapter<ACE_Null_Mutex> +#pragma instantiate class ACE_Map_Entry<ACE_CString, RT_Info **> +#pragma instantiate class ACE_Singleton<ACE_Scheduler::TaskManager> + +#if defined (ACE_HAS_THREADS) +#pragma instantiate class ACE_Lock_Adapter<ACE_RW_Thread_Mutex> +#pragma instantiate class ACE_Lock_Adapter<ACE_Thread_Mutex> +#pragma instantiate class ACE_Map_Manager<ACE_CString, RT_Info **, ACE_Thread_Mutex> +#pragma instantiate class ACE_Map_Iterator<ACE_CString, RT_Info **, ACE_Thread_Mutex> +#pragma instantiate class ACE_Read_Guard<ACE_Thread_Mutex> +#pragma instantiate class ACE_Write_Guard<ACE_Thread_Mutex> +#else +#pragma instantiate class ACE_Map_Manager<ACE_CString, RT_Info **, ACE_Null_Mutex> +#pragma instantiate class ACE_Map_Iterator<ACE_CString, RT_Info **, ACE_Null_Mutex> +#pragma instantiate class ACE_Read_Guard<ACE_Null_Mutex> +#pragma instantiate class ACE_Write_Guard<ACE_Null_Mutex> +#endif /* ACE_HAS_THREADS */ + +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + +// EOF diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduler.h b/TAO/orbsvcs/Scheduling_Service/Scheduler.h new file mode 100644 index 00000000000..2f128757be6 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Scheduler.h @@ -0,0 +1,278 @@ +/* -*- C++ -*- */ +// +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// sched +// +// = FILENAME +// Scheduler.h +// +// = CREATION DATE +// 23 January 1997 +// +// = AUTHOR +// David Levine +// +// ============================================================================ + +#if ! defined (SCHEDULER_H) +#define SCHEDULER_H + +#include "ace/ACE.h" +#include "ace/Map_Manager.h" +#include "ace/Message_Block.h" +#include "ace/Synch.h" +#include "ace/SString.h" + +#include "orbsvcs/RtecSchedulerC.h" +#include "orbsvcs/Event_Service_Constants.h" + +class ACE_Scheduler + // = TITLE + // Thread scheduler interface. + // + // = DESCRIPTION + // This virtual base class is the interface to either an off-line + // scheduler, or to the necessary on-line component of the Scheduler. +{ +public: + typedef u_int mode_t; + + typedef RtecScheduler::handle_t handle_t; + typedef RtecScheduler::Dependency_Info Dependency_Info; + typedef RtecScheduler::Preemption_Priority Preemption_Priority; + typedef RtecScheduler::OS_Priority OS_Thread_Priority; + typedef RtecScheduler::Sub_Priority Sub_Priority; + typedef RtecScheduler::RT_Info RT_Info; + // Map some types to simplify re-use. + + typedef const char *Object_Name; + // Objects are named by unique strings. + + static const mode_t CURRENT_MODE; + + enum status_t { + // The following are used both by the runtime Scheduler and during + // scheduling. + NOT_SCHEDULED = -1 // the schedule () method has not been called yet + , FAILED = -1 + , SUCCEEDED + , ST_UNKNOWN_TASK + , ST_TASK_ALREADY_REGISTERED + , ST_VIRTUAL_MEMORY_EXHAUSTED + + // The following are only used by the runtime Scheduler. + , INVALID_MODE + , MODE_COUNT_MISMATCH // only used by schedule () + , TASK_COUNT_MISMATCH // only used by schedule () + , INVALID_PRIORITY // only used by schedule (): mismatch of + // (off-line, maybe) Scheduler output to + // the runtime Scheduler component. + + // The following are only used during scheduling (in the case of + // off-line scheduling, they are only used prior to runtime). + , ST_UTILIZATION_BOUND_EXCEEDED + , ST_INSUFFICIENT_THREAD_PRIORITY_LEVELS + , ST_CYCLE_IN_DEPENDENCIES + , UNABLE_TO_OPEN_SCHEDULE_FILE + , UNABLE_TO_WRITE_SCHEDULE_FILE + }; + + virtual ~ACE_Scheduler (); + + // = Utility function for outputting the textual representation of a + // status_t value to a FILE. + static void output (FILE *, const status_t); + + // = Initialize the scheduler. + virtual void init (const int minimum_priority, + const int maximum_priority, + const char *runtime_filename = 0, + const char *rt_info_filename = 0, + const char *timeline_filename = 0) = 0; + // The minimum and maximum priority are the OS-specific priorities that + // are used when creating the schedule (assigning priorities). The + // minimum_priority is the priority value of the lowest priority. + // It may be numerically higher than the maximum_priority, on OS's such + // as VxWorks that use lower values to indicate higher priorities. + // + // When Scheduler::schedule is called, the schedule is output to the + // file named by "runtime_filename" if it is non-zero. + // This file is compilable; it is linked into the runtime executable + // to provide priorities to the runtime scheduling component. + // If the "rt_info_filename" is non-zero, the RT_Info for + // every task is exported to it. It is not used at runtime. + // If the "timeline_filename" is non-zero, the timeline output + // file is created. It is not used at runtime. + // + // The runtime scheduling component ignores these filenames. It just + // uses the priorities that were linked in to the executable, after + // converting them to platform-specific values. + + // = Registers a task. + virtual status_t register_task (RT_Info *[], + const u_int number_of_modes, + handle_t &handle) = 0; + // If the Task registration succeeds, this function returns SUCCEEDED + // and sets "handle" to a unique identifier for the task. + // Otherwise, it returns either VIRTUAL_MEMORY_EXHAUSTED or + // TASK_ALREADY_REGISTERED sets the handle to 0. (A task may + // only be registered once.) + // The RT_Info * array is indexed by mode; there must be one element for + // each mode, as specified by number_of_modes. If a task does not + // run in a mode, then its entry in the array for that mode must + // be 0. + + virtual status_t get_rt_info (Object_Name name, + RT_Info* &rtinfo); + // Tries to find the RT_Info corresponding to <name> in the RT_Info + // database. Returns SUCCEEDED if <name> was found and <rtinfo> was + // set. Returns UNKNOWN_TASK if <name> was not found, but <rtinfo> + // was set to a newly allocated RT_Info. In this UNKNOWN_TASK case, + // the task must call RT_Info::set to fill in execution properties. + // In the SUCCEEDED and UNKNOWN_TASK cases, this->register_task + // (rtinfo, 0, handle) is called. Returns FAILED if an error + // occurs. + // + // One motivation for allocating RT_Info's from within the Scheduler + // is to allow RT_Infos to persist after the tasks that use them. + // For instance, we may want to call this->schedule right before the + // application exits a configuration run. If the tasks have been + // deleted (deleting their RT_Infos with them), this->schedule will + // fail. + + virtual status_t lookup_rt_info (handle_t handle, + RT_Info* &rtinfo) = 0; + // Obtains an RT_Info based on its "handle". + + // = Computes the schedule. + virtual status_t schedule (void) = 0; + // This actually generates the files. + + // = Access a thread priority. + virtual int priority (const handle_t handle, + OS_Thread_Priority &priority, + Sub_Priority &subpriority, + Preemption_Priority &preemption_prio, + const mode_t = CURRENT_MODE) const = 0; + // Defines "priority" as the priority that was assigned to the Task that + // was assigned "handle", for the specified mode. Defines "subpriority" + // as the relative ordering (due to dependencies) within the priority. + // Returns 0 on success, or -1 if an invalid mode or handle are supplied. + // Queue numbers are platform-independent priority values, ranging from + // a highest priority value of 0 to the lowest priority value, which is + // returned by "minimum_priority_queue ()". + + // = Access the platform-independent priority value of the lowest-priority + // thread. + u_int minimum_priority_queue () const { return minimum_priority_queue_; } + // This is intended for use by the Event Channel, so it can determine the + // number of priority dispatch queues to create. + + // = Access the number of modes. + u_int modes () const { return modes_; } + + // = Access the number of tasks. + u_int tasks () const { return tasks_; } + + // = Access the number of threads. + u_int threads () const { return threads_; } + + // = Access the current mode. + mode_t mode () const { return mode_; } + + // = Set the current mode. + void mode (const mode_t mode) { mode_ = mode; } + + // = Access the current scheduler status. + status_t status () const { return status_; } + + // = Access the current output (debugging) level. + u_int output_level () const { return output_level_; } + // Default is 0; set to 1 to print out schedule, by task. Set + // to higher than one for debugging info. + + // = Set the scheduler output (debugging) level. + void output_level (const u_int level) { output_level_ = level; } + // the only supported levels are 0 (quiet), 1 (verbose) and 2 + // (debug) + + static int add_dependency(RT_Info* rt_info, + const Dependency_Info& d); + + static int number_of_dependencies(RT_Info* rt_info); + static int number_of_dependencies(RT_Info& rt_info); + + static void export(RT_Info*, FILE* file); + static void export(RT_Info&, FILE* file); + +protected: + ACE_Scheduler (); + + // = Set the minimum priority value. + void minimum_priority_queue (const u_int minimum_priority_queue_number) + { minimum_priority_queue_ = minimum_priority_queue_number; } + + // = Set the number of modes. + void modes (const u_int modes) { modes_ = modes; } + + // = Set the number of tasks. + void tasks (const u_int tasks) { tasks_ = tasks; } + + // = Set the number of threads. + void threads (const u_int threads) { threads_ = threads; } + + // = Set the current scheduler status. + void status (const status_t new_status) { status_ = new_status; } + +private: + typedef ACE_CString EXT; + typedef RT_Info **INT; + +#if defined (ACE_HAS_THREADS) + typedef ACE_Thread_Mutex SYNCH; +#else + typedef ACE_Null_Mutex SYNCH; +#endif /* ACE_HAS_THREADS */ + + typedef ACE_Map_Manager<EXT, INT, SYNCH> Info_Collection; + typedef ACE_Map_Iterator<EXT, INT, SYNCH> Info_Collection_Iterator; + typedef ACE_Map_Entry<EXT, INT> Info_Collection_Entry; + + Info_Collection info_collection_; + // A binding of name to rt_info. This is the mapping for every + // rt_info in the process. + + static ACE_Scheduler *instance_; + + u_int minimum_priority_queue_; + // The platform-independent priority value of the Event Channel's + // minimum priority dispatch queue. The value of the maximum priority + // dispatch queue is always 0. + + u_int modes_; + u_int tasks_; + u_int threads_; + + mode_t mode_; + status_t status_; + u_int output_level_; + + // the following functions are not implememented + ACE_UNIMPLEMENTED_FUNC(ACE_Scheduler (const ACE_Scheduler &)) + ACE_UNIMPLEMENTED_FUNC(ACE_Scheduler &operator= (const ACE_Scheduler &)) +}; + +typedef ACE_Scheduler Scheduler; + +#if defined (__ACE_INLINE__) +#include "Scheduler.i" +#endif /* __ACE_INLINE__ */ + +#endif /* SCHEDULER_H */ + + +// EOF diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduler.i b/TAO/orbsvcs/Scheduling_Service/Scheduler.i new file mode 100644 index 00000000000..57875ae26d1 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Scheduler.i @@ -0,0 +1,20 @@ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// sched +// +// = FILENAME +// Scheduler.i +// +// = CREATION DATE +// 23 January 1997 +// +// = AUTHOR +// David Levine +// +// ============================================================================ + +// EOF + diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduler_Generic.cpp b/TAO/orbsvcs/Scheduling_Service/Scheduler_Generic.cpp new file mode 100644 index 00000000000..8bf453047d4 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Scheduler_Generic.cpp @@ -0,0 +1,258 @@ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// sched +// +// = FILENAME +// Scheduler_Generic.cpp +// +// = CREATION DATE +// 19 November 1997 +// +// = AUTHOR +// David Levine +// +// ============================================================================ + +#include "ace/Sched_Params.h" + +#include "Scheduler_Generic.h" + +#if ! defined (__ACE_INLINE__) +#include "Scheduler_Generic.i" +#endif /* __ACE_INLINE__ */ + + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// static functions +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +// Structure for storing the RT_Info information for each task, per mode. +struct Mode_Entry +{ + RtecScheduler::RT_Info *rt_info_; + u_long start_time_; // microseconds + u_long stop_time_; // microseconds + + Mode_Entry() : + rt_info_ (0), + start_time_ (0), + stop_time_ (0) + { + } + + Mode_Entry(RtecScheduler::RT_Info *const rt_info, + const u_long start_time = 0, + const u_long stop_time = 0) : + rt_info_ (rt_info), + start_time_ (start_time), + stop_time_ (stop_time) + { + } + + ~Mode_Entry () {} + + Mode_Entry &operator= (const Mode_Entry &entry) + { + if (this != &entry) + { + rt_info_ = entry.rt_info_; + start_time_ = entry.start_time_; + stop_time_ = entry.stop_time_; + } + + return *this; + } +}; + + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// class Scheduler_Generic member functions +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// + +Scheduler_Generic::Scheduler_Generic () : + Scheduler (), + handles_ (0), + // Set the minimum priority to that for the current platform. This + // shouldn't be necessary, but UPSingleProcessorOrb::initialize_reactors + // creates threads before the Event Channel calls Scheduler::init (). + minimum_priority_ (ACE_Sched_Params::priority_min (ACE_SCHED_FIFO, + ACE_SCOPE_THREAD)), + increasing_priority_ (-1), + task_entries_ () +{ +} + + +Scheduler_Generic::~Scheduler_Generic () +{ + reset (); +} + + +void +Scheduler_Generic::reset () +{ +} + +Scheduler::status_t +Scheduler_Generic::lookup_rt_info (handle_t handle, + RT_Info*& rtinfo) +{ + if (handle < 0 || (size_t) handle > task_entries_.size ()) + { + return ST_UNKNOWN_TASK; + } + RT_Info*** entry; + ACE_Unbounded_Set_Iterator <RT_Info **> i (task_entries_); + while (i.next (entry) != 0) + { + i.advance (); + RT_Info** array = *entry; + if (array[0]->handle == handle) + { + rtinfo = array[0]; + return SUCCEEDED; + } + } + + return ST_UNKNOWN_TASK; +} + + +Scheduler::status_t +Scheduler_Generic::register_task (RT_Info *rt_info [], + const u_int number_of_modes, + handle_t &handle) +{ + status_t ret; + + // try to store the new task's information . . . + switch (task_entries_.insert (rt_info)) + { + case 0 : // successfully inserted + { + rt_info [0]->handle = (handle = ++handles_); + + // assigned the same handle to the RT_Info for each of its modes + for (u_int i = 1; i < number_of_modes; ++i) + { + if (rt_info [i] != 0) + rt_info [i]->handle = handle; + } + + if (number_of_modes > modes ()) + { + modes (number_of_modes); + } + + ret = SUCCEEDED; + + if (output_level () >= 5) + { + ACE_OS::printf ("registered task \"%s\" with RT_Info starting " + "at %X\n", + (const char*)rt_info[0]->entry_point, + (void *) rt_info[0]); + } + } + break; + + case 1 : // the entry had already been inserted + handle = 0; + ret = ST_TASK_ALREADY_REGISTERED; + break; + + default : + // case -1 : insert failed, probably because virtual memory exhaused + handle = 0; + ret = ST_VIRTUAL_MEMORY_EXHAUSTED; + break; + } + + return ret; +} + + +void +Scheduler_Generic::init (const int minimum_priority, + const int maximum_priority, + const char *runtime_filename, + const char *rt_info_filename, + const char *timeline_filename) +{ + minimum_priority_ = minimum_priority; + maximum_priority_ = maximum_priority; + runtime_filename_ = runtime_filename; + rt_info_filename_ = rt_info_filename; + timeline_filename_ = timeline_filename; +} + + +Scheduler::status_t +Scheduler_Generic::schedule (void) +{ + ACE_Guard<LOCK> ace_mon (lock_); + + // here goes . . . + + increasing_priority_ = maximum_priority_ >= minimum_priority_; + + status_t status = ACE_Scheduler::SUCCEEDED; + + // store number of tasks, based on registrations + tasks (task_entries_.size ()); + + if (output_level () > 0) + { + print_schedule (); + } + + return status; +} + + +int +Scheduler_Generic::priority (const handle_t handle, + OS_Thread_Priority &priority, + Sub_Priority &subpriority, + Preemption_Priority &preemption_prio, + const mode_t requested_mode) const +{ + ACE_UNUSED_ARG (handle); + ACE_UNUSED_ARG (requested_mode); + + priority = minimum_priority_; + subpriority = ACE_Scheduler_MIN_SUB_PRIORITY; + preemption_prio = ACE_Scheduler_MAX_PREEMPTION_PRIORITY; + + if (output_level () >= 3) + { + ACE_OS::printf ("preemption_prio %d: min %d, pri %d, min_pri %d\n", + preemption_prio, minimum_priority_queue (), + priority, minimum_priority_); + } + + return 0; +} + + +void +Scheduler_Generic::print_schedule () +{ +} + +#if defined (ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION) +template class ACE_Node<RtecScheduler::RT_Info **>; +template class ACE_Unbounded_Set<RtecScheduler::RT_Info **>; +template class ACE_Unbounded_Set_Iterator<RtecScheduler::RT_Info **>; +#endif /* ACE_HAS_EXPLICIT_TEMPLATE_INSTANTIATION */ + + +// EOF diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduler_Generic.h b/TAO/orbsvcs/Scheduling_Service/Scheduler_Generic.h new file mode 100644 index 00000000000..ab22666a41e --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Scheduler_Generic.h @@ -0,0 +1,129 @@ +/* -*- C++ -*- */ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// sched +// +// = FILENAME +// Scheduler_Generic.h +// +// = CREATION DATE +// 19 November 1997 +// +// = AUTHOR +// David Levine +// +// ============================================================================ + +#if ! defined (SCHEDULER_INTERNAL_H) +#define SCHEDULER_INTERNAL_H + +#include "Scheduler.h" + +class Scheduler_Generic : public ACE_Scheduler + // = TITLE + // Implementation of an off-line scheduler. + // + // = DESCRIPTION + // Schedules tasks, assigning the same priority to all of them. +{ +public: + Scheduler_Generic (); + virtual ~Scheduler_Generic (); + + // = Initialize the scheduler. + virtual void init (const int minimum_priority, + const int maximum_priority, + const char *runtime_filename = 0, + const char *rt_info_filename = 0, + const char *timeline_filename = 0); + + // = Registers a task. + virtual status_t register_task (RT_Info *[], + const u_int number_of_modes, + handle_t &handle); + + virtual status_t lookup_rt_info (handle_t handle, + RT_Info* &rtinfo); + // Obtains an RT_Info based on its "handle". + + // = Computes the schedule. + virtual status_t schedule (void); + + // = Access a thread priority. + virtual int priority (const handle_t handle, + OS_Thread_Priority &priority, + Sub_Priority &subpriority, + Preemption_Priority &preemption_prio, + const mode_t = CURRENT_MODE) const; + // Defines "priority" as the priority that was assigned to the Task that + // was assigned "handle", for the specified mode. Defines "subpriority" + // as the relative ordering (due to dependencies) within the priority. + // Returns 0 on success, or 1 if an invalid mode or handle are supplied. + +private: + u_int handles_; + // The number of task handles dispensed so far. + + int minimum_priority_; + // The minimum priority value that the application specified (in + // its call to init ()). + + int maximum_priority_; + // The maximum priority value that the application specified (in + // its call to init ()). + + const char *runtime_filename_; + // Destination file of Scheduler output from the configuration run. + + const char *rt_info_filename_; + // Destination file of all rt_info data from the configuration run. + + const char *timeline_filename_; + // The destination of the timeline. + + int increasing_priority_; + // Set to 1 if priority values increase with increasing priority, + // such as on Solaris and Win32, or 0 if they decrease, such as on + // VxWorks. + + ACE_Unbounded_Set <RT_Info **> task_entries_; + // Collection of known tasks. + +#if defined (ACE_HAS_THREADS) + typedef ACE_Recursive_Thread_Mutex LOCK; +#else + typedef ACE_Null_Mutex LOCK; +#endif /* ACE_HAS_THREADS */ + + LOCK lock_; + // This protects access to the scheduler during configuration runs. + + + /////////////////////////////////////// + // member functions for internal use // + /////////////////////////////////////// + + void reset (); + // Prepare for another schedule computation, but do not + // disturb the "output" (priorities that have already been assigned). + + void print_schedule (); + // Display the schedule, task-by-task. + + ACE_UNIMPLEMENTED_FUNC (Scheduler_Generic (const Scheduler_Generic &)) + ACE_UNIMPLEMENTED_FUNC (Scheduler_Generic &operator= ( + const Scheduler_Generic &)) +}; + + +#if defined (__ACE_INLINE__) +#include "Scheduler_Generic.i" +#endif /* __ACE_INLINE__ */ + +#endif /* SCHEDULER_INTERNAL_H */ + + +// EOF diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduler_Generic.i b/TAO/orbsvcs/Scheduling_Service/Scheduler_Generic.i new file mode 100644 index 00000000000..71e3695dc35 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Scheduler_Generic.i @@ -0,0 +1,21 @@ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// sched +// +// = FILENAME +// Scheduler_Generic.i +// +// = CREATION DATE +// 23 January 1997 +// +// = AUTHOR +// David Levine +// +// ============================================================================ + + +// EOF + diff --git a/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp new file mode 100644 index 00000000000..e76579598b5 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/Scheduling_Service.cpp @@ -0,0 +1,67 @@ +// +// $Id$ +// + +#include "tao/corba.h" + +#include "orbsvcs/CosNamingC.h" +#include "Config_Scheduler.h" + +int main (int argc, char *argv[]) +{ + ACE_TRY + { + // Initialize ORB. + CORBA::ORB_ptr orb = + CORBA::ORB_init (argc, argv, "internet", ACE_TRY_ENV); + ACE_CHECK_ENV; + + CORBA::POA_ptr poa = + orb->POA_init(argc, argv, "POA"); + if (poa == 0) + { + ACE_ERROR_RETURN ((LM_ERROR, + " (%P|%t) Unable to initialize the POA.\n"), + 1); + } + + CORBA::Object_ptr objref = + orb->resolve_initial_references ("NameService"); + ACE_CHECK_ENV; + + CosNaming::NamingContext_var naming_context = + CosNaming::NamingContext::_narrow (objref, ACE_TRY_ENV); + ACE_CHECK_ENV; + + // Create an Scheduling service servant... + RtecScheduler::Scheduler_ptr scheduler = new ACE_Config_Scheduler; + // CORBA::Object::_duplicate(scheduler); + ACE_CHECK_ENV; + + CORBA::String str = + orb->object_to_string (scheduler, ACE_TRY_ENV); + ACE_OS::puts ((char *) str); + + // Register the servant with the Naming Context.... + CosNaming::Name schedule_name (1); + schedule_name[0].id = CORBA::string_dup ("ScheduleService"); + schedule_name.length (1); + naming_context->bind (schedule_name, scheduler, ACE_TRY_ENV); + ACE_CHECK_ENV; + + ACE_DEBUG ((LM_DEBUG, "running scheduling service\n")); + if (orb->run () == -1) + { + ACE_ERROR_RETURN ((LM_ERROR, "%p\n", "run"), 1); + } + + CORBA::release (scheduler); + } + ACE_CATCHANY + { + ACE_TRY_ENV.print_exception ("schedule_service"); + } + ACE_ENDTRY; + + return 0; +} diff --git a/TAO/orbsvcs/Scheduling_Service/svc.conf b/TAO/orbsvcs/Scheduling_Service/svc.conf new file mode 100644 index 00000000000..43c6a486c92 --- /dev/null +++ b/TAO/orbsvcs/Scheduling_Service/svc.conf @@ -0,0 +1,49 @@ +# $Id$ +# +# This file contains a sample ACE_Service_Config configuration +# file specifying the strategy factories utilized by an application +# using TAO. There are currently only two possible factories: +# Client_Strategy_Factory and Server_Strategy_Factory. These names +# must be used as the second argument to their corresponding line, +# because that's what the ORB uses to find the desired factory. +# +# Note that there are two unordinary characteristics of the way *this* +# file is set up: +# - both client and server strategies are specified in the same +# file, which would only make sense for co-located clients & servers +# - both of the factories are actually sourced out of libTAO.so +# (TAO.DLL on Win32), and they would normally be in a separate +# dll from the TAO ORB Core. +# +# The options which can be passed to the Resource Factory are: +# +# -ORBresources <which> +# where <which> can be 'global' to specify globally-held resources, +# or 'tss' to specify thread-specific resources. +# +# The options which can be passed to the Client are: +# <none currently> +# +# The options which can be passed to the Server are: +# +# -ORBconcurrency <which> +# where <which> can be 'thread-per-connection' to specify +# use of the ACE_Threaded_Strategy concurrency strategy, +# or 'reactive' to specify use of the ACE_Reactive_Strategy +# concurrency strategy. +# +# -ORBthreadflags <flags> +# specifies the default thread flags to use, where <flags> is a +# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, +# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid +# on every platform. +# +# -ORBdemuxstrategy <which> +# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', +# and specifies the type of object lookup strategy used internally. +# -ORBtablesize <unsigned> +# specifies the size of the object table +# +dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources global" +dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() +dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128" diff --git a/TAO/orbsvcs/bin/Makefile b/TAO/orbsvcs/bin/Makefile deleted file mode 100644 index e84d47d9556..00000000000 --- a/TAO/orbsvcs/bin/Makefile +++ /dev/null @@ -1,22 +0,0 @@ -#---------------------------------------------------------------------------- -# -# $Id$ -# -#---------------------------------------------------------------------------- - -#---------------------------------------------------------------------------- -# Local macros -#---------------------------------------------------------------------------- - -DIRS = Naming_Service - -#---------------------------------------------------------------------------- -# Include macros and targets -#---------------------------------------------------------------------------- - -include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU -include $(ACE_ROOT)/include/makeinclude/macros.GNU -include $(ACE_ROOT)/include/makeinclude/rules.common.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nested.GNU -include $(ACE_ROOT)/include/makeinclude/rules.nolocal.GNU - diff --git a/TAO/orbsvcs/lib/Channel_Clients.cpp b/TAO/orbsvcs/orbsvcs/Channel_Clients.cpp index cfa1da318d3..cfa1da318d3 100644 --- a/TAO/orbsvcs/lib/Channel_Clients.cpp +++ b/TAO/orbsvcs/orbsvcs/Channel_Clients.cpp diff --git a/TAO/orbsvcs/lib/Channel_Clients.h b/TAO/orbsvcs/orbsvcs/Channel_Clients.h index 57781f9f3a7..487e688eb2c 100644 --- a/TAO/orbsvcs/lib/Channel_Clients.h +++ b/TAO/orbsvcs/orbsvcs/Channel_Clients.h @@ -17,10 +17,10 @@ #ifndef ACE_CHANNEL_CLIENTS_H #define ACE_CHANNEL_CLIENTS_H -#include "Channel_Clients_T.h" +#include "orbsvcs/Channel_Clients_T.h" #if defined (__ACE_INLINE__) -#include "Channel_Clients.i" +#include "orbsvcs/Channel_Clients.i" #endif /* __ACE_INLINE__ */ #endif /* ACE_CHANNEL_CLIENTS_H */ diff --git a/TAO/orbsvcs/lib/Channel_Clients_T.cpp b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp index 3207d44f091..64704ad2060 100644 --- a/TAO/orbsvcs/lib/Channel_Clients_T.cpp +++ b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.cpp @@ -3,10 +3,10 @@ #ifndef ACE_CHANNEL_CLIENTS_T_C #define ACE_CHANNEL_CLIENTS_T_C -#include "Channel_Clients_T.h" +#include "orbsvcs/Channel_Clients_T.h" #if !defined (__ACE_INLINE__) -#include "Channel_Clients_T.i" +#include "orbsvcs/Channel_Clients_T.i" #endif /* __ACE_INLINE__ */ #endif /* ACE_CHANNEL_CLIENTS_T_C */ diff --git a/TAO/orbsvcs/lib/Channel_Clients_T.h b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.h index 732353773eb..1dd52e82ea6 100644 --- a/TAO/orbsvcs/lib/Channel_Clients_T.h +++ b/TAO/orbsvcs/orbsvcs/Channel_Clients_T.h @@ -24,7 +24,7 @@ #ifndef ACE_CHANNEL_CLIENTS_T_H #define ACE_CHANNEL_CLIENTS_T_H -#include "RtecEventCommC.h" +#include "orbsvcs/RtecEventCommC.h" // TODO: Add throw specs to this classes. @@ -73,11 +73,11 @@ private: }; #if defined (__ACE_INLINE__) -#include "Channel_Clients_T.i" +#include "orbsvcs/Channel_Clients_T.i" #endif /* __ACE_INLINE__ */ #if defined (ACE_TEMPLATES_REQUIRE_SOURCE) -#include "Channel_Clients_T.cpp" +#include "orbsvcs/Channel_Clients_T.cpp" #endif /* ACE_TEMPLATES_REQUIRE_SOURCE */ #if defined (ACE_TEMPLATES_REQUIRE_PRAGMA) diff --git a/TAO/orbsvcs/lib/CosNaming.idl b/TAO/orbsvcs/orbsvcs/CosNaming.idl index 770a2adea9f..770a2adea9f 100644 --- a/TAO/orbsvcs/lib/CosNaming.idl +++ b/TAO/orbsvcs/orbsvcs/CosNaming.idl diff --git a/TAO/orbsvcs/lib/Event_Service_Constants.h b/TAO/orbsvcs/orbsvcs/Event_Service_Constants.h index 9aae513b530..d65f865139a 100644 --- a/TAO/orbsvcs/lib/Event_Service_Constants.h +++ b/TAO/orbsvcs/orbsvcs/Event_Service_Constants.h @@ -9,8 +9,8 @@ #if !defined (ACE_ES_CONSTANTS_H) #define ACE_ES_CONSTANTS_H -#include <ace/Message_Block.h> -#include <ace/Synch.h> +#include "ace/Message_Block.h" +#include "ace/Synch.h" const int ACE_ES_MAX_SUBSCRIPTIONS = 32; // This is the number of events a consumer can subscribe to. diff --git a/TAO/orbsvcs/lib/Event_Utilities.cpp b/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp index a7ac2305d1b..256f4d65b73 100644 --- a/TAO/orbsvcs/lib/Event_Utilities.cpp +++ b/TAO/orbsvcs/orbsvcs/Event_Utilities.cpp @@ -1,10 +1,10 @@ // // $Id$ // -#include "Event_Utilities.h" +#include "orbsvcs/Event_Utilities.h" #if !defined (__ACE_INLINE__) -#include "Event_Utilities.i" +#include "orbsvcs/Event_Utilities.i" #endif /* __ACE_INLINE__ */ ACE_ConsumerQOS_Factory::ACE_ConsumerQOS_Factory (void) : diff --git a/TAO/orbsvcs/lib/Event_Utilities.h b/TAO/orbsvcs/orbsvcs/Event_Utilities.h index ea6ab98f631..bd31d8425e7 100644 --- a/TAO/orbsvcs/lib/Event_Utilities.h +++ b/TAO/orbsvcs/orbsvcs/Event_Utilities.h @@ -17,8 +17,8 @@ #ifndef ACE_EVENT_UTILITIES_H #define ACE_EVENT_UTILITIES_H -#include "RtecEventChannelAdminC.h" -#include "Event_Service_Constants.h" +#include "orbsvcs/RtecEventChannelAdminC.h" +#include "orbsvcs/Event_Service_Constants.h" class ACE_ConsumerQOS_Factory // = TITLE @@ -215,7 +215,8 @@ private: #if defined (__ACE_INLINE__) -#include "Event_Utilities.i" +#include "orbsvcs/Event_Utilities.i" #endif /* __ACE_INLINE__ */ + #endif /* ACE_EVENT_UTILITIES_H */ diff --git a/TAO/orbsvcs/lib/Event_Utilities.i b/TAO/orbsvcs/orbsvcs/Event_Utilities.i index 49cc031a517..49cc031a517 100644 --- a/TAO/orbsvcs/lib/Event_Utilities.i +++ b/TAO/orbsvcs/orbsvcs/Event_Utilities.i diff --git a/TAO/orbsvcs/lib/Makefile b/TAO/orbsvcs/orbsvcs/Makefile index 2fce2c792f8..fc1b97441fb 100644 --- a/TAO/orbsvcs/lib/Makefile +++ b/TAO/orbsvcs/orbsvcs/Makefile @@ -1,6 +1,6 @@ #---------------------------------------------------------------------------- # -# $Id$ +# $Id$ # #---------------------------------------------------------------------------- @@ -12,10 +12,10 @@ SHLIB = $(LIBNAME).$(SOEXT) IDL_FILES = \ CosNamingC \ CosNamingS \ - RtecSchedulerC \ - RtecSchedulerS \ RtecEventCommC \ RtecEventCommS \ + RtecSchedulerC \ + RtecSchedulerS \ RtecEventChannelAdminC \ RtecEventChannelAdminS \ @@ -51,7 +51,7 @@ TAO_ROOT = $(ACE_ROOT)/TAO endif LDFLAGS += -L$(TAO_ROOT)/tao -CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H +CPPFLAGS += -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat -I$(TAO_ROOT)/orbsvcs $(TSS_ORB_FLAG)#-H # @@ Commented out until no more hand-crafting is needed, right now the # main problem is the ACE_Export macros for NT. @@ -68,7 +68,6 @@ RtecEventCommC.cpp RtecEventCommS.cpp RtecEventCommC.h RtecEventCommS.h: RtecEve RtecEventChannelAdminC.cpp RtecEventChannelAdminS.cpp RtecEventChannelAdminC.h RtecEventChannelAdminS.h: RtecEventChannelAdmin.idl $(TAO_ROOT)/TAO_IDL/tao_idl $^ -clean: -/bin/rm -rf *.o Log $(BIN) obj.* core Templates.DB .make.state realclean: clean @@ -186,6 +185,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -350,6 +351,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -406,7 +409,7 @@ realclean: clean $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ CosNamingC.i CosNamingS.i -.obj/RtecSchedulerC.o .shobj/RtecSchedulerC.so: RtecSchedulerC.cpp RtecSchedulerC.h \ +.obj/RtecEventCommC.o .shobj/RtecEventCommC.so: RtecEventCommC.cpp RtecEventCommC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ @@ -514,6 +517,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -569,8 +574,8 @@ realclean: clean $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - RtecSchedulerC.i -.obj/RtecSchedulerS.o .shobj/RtecSchedulerS.so: RtecSchedulerS.cpp RtecSchedulerS.h RtecSchedulerC.h \ + RtecEventCommC.i +.obj/RtecEventCommS.o .shobj/RtecEventCommS.so: RtecEventCommS.cpp RtecEventCommS.h RtecEventCommC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ @@ -678,6 +683,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -733,8 +740,8 @@ realclean: clean $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - RtecSchedulerC.i RtecSchedulerS.i -.obj/RtecEventCommC.o .shobj/RtecEventCommC.so: RtecEventCommC.cpp RtecEventCommC.h \ + RtecEventCommC.i RtecEventCommS.i +.obj/RtecSchedulerC.o .shobj/RtecSchedulerC.so: RtecSchedulerC.cpp RtecSchedulerC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ @@ -842,6 +849,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -897,8 +906,8 @@ realclean: clean $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - RtecEventCommC.i -.obj/RtecEventCommS.o .shobj/RtecEventCommS.so: RtecEventCommS.cpp RtecEventCommS.h RtecEventCommC.h \ + RtecSchedulerC.i +.obj/RtecSchedulerS.o .shobj/RtecSchedulerS.so: RtecSchedulerS.cpp RtecSchedulerS.h RtecSchedulerC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ @@ -1006,6 +1015,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -1061,7 +1072,7 @@ realclean: clean $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - RtecEventCommC.i RtecEventCommS.i + RtecSchedulerC.i RtecSchedulerS.i .obj/RtecEventChannelAdminC.o .shobj/RtecEventChannelAdminC.so: RtecEventChannelAdminC.cpp \ RtecEventChannelAdminC.h \ $(TAO_ROOT)/tao/corba.h \ @@ -1171,6 +1182,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -1337,6 +1350,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -1395,8 +1410,9 @@ realclean: clean RtecEventCommC.i RtecEventCommS.i RtecSchedulerS.h RtecSchedulerC.h \ RtecSchedulerC.i RtecSchedulerS.i RtecEventChannelAdminC.h \ RtecEventChannelAdminC.i RtecEventChannelAdminS.i -.obj/Event_Utilities.o .shobj/Event_Utilities.so: Event_Utilities.cpp Event_Utilities.h \ - RtecEventChannelAdminC.h \ +.obj/Event_Utilities.o .shobj/Event_Utilities.so: Event_Utilities.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Utilities.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ @@ -1504,6 +1520,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -1559,10 +1577,29 @@ realclean: clean $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - RtecEventCommC.h RtecEventCommC.i RtecSchedulerC.h RtecSchedulerC.i \ - RtecEventChannelAdminC.i Event_Service_Constants.h Event_Utilities.i -.obj/Scheduler_Factory.o .shobj/Scheduler_Factory.so: Scheduler_Factory.cpp Runtime_Scheduler.h \ - RtecSchedulerS.h RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Utilities.i +.obj/Scheduler_Factory.o .shobj/Scheduler_Factory.so: Scheduler_Factory.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Runtime_Scheduler.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/Get_Opt.h \ $(ACE_ROOT)/ace/Get_Opt.i \ @@ -1658,6 +1695,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -1713,9 +1752,15 @@ realclean: clean $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - RtecSchedulerC.i RtecSchedulerS.i Runtime_Scheduler.i \ - Scheduler_Factory.h CosNamingC.h CosNamingC.i Scheduler_Factory.i -.obj/Runtime_Scheduler.o .shobj/Runtime_Scheduler.so: Runtime_Scheduler.cpp Runtime_Scheduler.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Runtime_Scheduler.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.i +.obj/Runtime_Scheduler.o .shobj/Runtime_Scheduler.so: Runtime_Scheduler.cpp \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Runtime_Scheduler.h \ $(ACE_ROOT)/ace/OS.h \ $(ACE_ROOT)/ace/config.h \ $(ACE_ROOT)/ace/streams.h \ @@ -1728,7 +1773,8 @@ realclean: clean $(ACE_ROOT)/ace/ACE.i \ $(ACE_ROOT)/ace/Log_Priority.h \ $(ACE_ROOT)/ace/Log_Record.i \ - RtecSchedulerS.h RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/Get_Opt.h \ $(ACE_ROOT)/ace/Get_Opt.i \ @@ -1824,6 +1870,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -1879,9 +1927,24 @@ realclean: clean $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - RtecSchedulerC.i RtecSchedulerS.i Runtime_Scheduler.i -.obj/Scheduler_Utilities.o .shobj/Scheduler_Utilities.so: Scheduler_Utilities.cpp Scheduler_Utilities.h \ - RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerS.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Runtime_Scheduler.i +.obj/Scheduler_Utilities.o .shobj/Scheduler_Utilities.so: Scheduler_Utilities.cpp \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Utilities.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ $(TAO_ROOT)/tao/corba.h \ $(ACE_ROOT)/ace/Get_Opt.h \ $(ACE_ROOT)/ace/Get_Opt.i \ @@ -1977,6 +2040,8 @@ realclean: clean $(ACE_ROOT)/ace/Connector.i \ $(ACE_ROOT)/ace/Acceptor.h \ $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ $(TAO_ROOT)/tao/orbconf.h \ $(TAO_ROOT)/tao/orb.h \ $(TAO_ROOT)/tao/corbacom.h \ @@ -2032,6 +2097,7 @@ realclean: clean $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ $(TAO_ROOT)/tao/singletons.h \ - RtecSchedulerC.i Scheduler_Utilities.i + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Utilities.i # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/lib/RtecEventChannelAdmin.idl b/TAO/orbsvcs/orbsvcs/RtecEventChannelAdmin.idl index ec0147abbb9..ec0147abbb9 100644 --- a/TAO/orbsvcs/lib/RtecEventChannelAdmin.idl +++ b/TAO/orbsvcs/orbsvcs/RtecEventChannelAdmin.idl diff --git a/TAO/orbsvcs/lib/RtecEventComm.idl b/TAO/orbsvcs/orbsvcs/RtecEventComm.idl index 5171aaa4438..5171aaa4438 100644 --- a/TAO/orbsvcs/lib/RtecEventComm.idl +++ b/TAO/orbsvcs/orbsvcs/RtecEventComm.idl diff --git a/TAO/orbsvcs/lib/RtecScheduler.idl b/TAO/orbsvcs/orbsvcs/RtecScheduler.idl index e0d2ea9fa0f..e0d2ea9fa0f 100644 --- a/TAO/orbsvcs/lib/RtecScheduler.idl +++ b/TAO/orbsvcs/orbsvcs/RtecScheduler.idl diff --git a/TAO/orbsvcs/lib/Runtime_Scheduler.cpp b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp index 183800b8ad1..315117e5610 100644 --- a/TAO/orbsvcs/lib/Runtime_Scheduler.cpp +++ b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.cpp @@ -4,10 +4,10 @@ // // ============================================================================ -#include "Runtime_Scheduler.h" +#include "orbsvcs/Runtime_Scheduler.h" #if defined (__ACE_INLINE__) -#include "Runtime_Scheduler.i" +#include "orbsvcs/Runtime_Scheduler.i" #endif /* __ACE_INLINE__ */ ACE_Runtime_Scheduler:: diff --git a/TAO/orbsvcs/lib/Runtime_Scheduler.h b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h index 4209b7cbf44..e77513041dd 100644 --- a/TAO/orbsvcs/lib/Runtime_Scheduler.h +++ b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.h @@ -9,7 +9,7 @@ #include "ace/OS.h" -#include "RtecSchedulerS.h" +#include "orbsvcs/RtecSchedulerS.h" class ACE_Runtime_Scheduler : public POA_RtecScheduler::Scheduler @@ -90,7 +90,7 @@ private: }; #if defined (__ACE_INLINE__) -#include "Runtime_Scheduler.i" +#include "orbsvcs/Runtime_Scheduler.i" #endif /* __ACE_INLINE__ */ #endif /* ACE_RUNTIME_SCHEDULER_H */ diff --git a/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.i b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.i new file mode 100644 index 00000000000..a21ea7f9897 --- /dev/null +++ b/TAO/orbsvcs/orbsvcs/Runtime_Scheduler.i @@ -0,0 +1,5 @@ +// ============================================================================ +// +// $Id$ +// +// ============================================================================ diff --git a/TAO/orbsvcs/lib/Scheduler_Factory.cpp b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp index 62100acf06b..850b1a159d9 100644 --- a/TAO/orbsvcs/lib/Scheduler_Factory.cpp +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.cpp @@ -4,13 +4,13 @@ // // ============================================================================ -#include <ace/OS.h> +#include "ace/OS.h" -#include "Runtime_Scheduler.h" -#include "Scheduler_Factory.h" +#include "orbsvcs/Runtime_Scheduler.h" +#include "orbsvcs/Scheduler_Factory.h" #if ! defined (__ACE_INLINE__) -#include "Scheduler_Factory.i" +#include "orbsvcs/Scheduler_Factory.i" #endif /* __ACE_INLINE__ */ RtecScheduler::Scheduler_ptr ACE_Scheduler_Factory::server_ = 0; @@ -180,7 +180,7 @@ static char header[] = "// This file was automatically generated by Scheduler_Factory\n" "// before editing the file please consider generating it again\n" "\n" -"#include \"Scheduler_Factory.h\"\n" +"#include \"orbsvcs/Scheduler_Factory.h\"\n" "\n"; static char footer[] = diff --git a/TAO/orbsvcs/lib/Scheduler_Factory.h b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.h index 2529b0be35a..fa2411cd9e9 100644 --- a/TAO/orbsvcs/lib/Scheduler_Factory.h +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.h @@ -9,8 +9,8 @@ #include "ace/OS.h" -#include "RtecSchedulerC.h" -#include "CosNamingC.h" +#include "orbsvcs/CosNamingC.h" +#include "orbsvcs/RtecSchedulerC.h" class ACE_Scheduler_Factory // = TITLE @@ -92,7 +92,7 @@ private: }; #if defined (__ACE_INLINE__) -#include "Scheduler_Factory.i" +#include "orbsvcs/Scheduler_Factory.i" #endif /* __ACE_INLINE__ */ #endif /* ACE_SCHEDULER_FACTORY_H */ diff --git a/TAO/orbsvcs/lib/Scheduler_Factory.i b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.i index 8d85b9d5a37..8d85b9d5a37 100644 --- a/TAO/orbsvcs/lib/Scheduler_Factory.i +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Factory.i diff --git a/TAO/orbsvcs/lib/Scheduler_Utilities.cpp b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.cpp index 78147115178..ffea37fb9fe 100644 --- a/TAO/orbsvcs/lib/Scheduler_Utilities.cpp +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.cpp @@ -4,11 +4,11 @@ // // ============================================================================ -#include <ace/OS.h> +#include "ace/OS.h" -#include "Scheduler_Utilities.h" +#include "orbsvcs/Scheduler_Utilities.h" #if ! defined (__ACE_INLINE__) -#include "Scheduler_Utilities.i" +#include "orbsvcs/Scheduler_Utilities.i" #endif /* __ACE_INLINE__ */ diff --git a/TAO/orbsvcs/lib/Scheduler_Utilities.h b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.h index 2475751020a..b0b3b529722 100644 --- a/TAO/orbsvcs/lib/Scheduler_Utilities.h +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.h @@ -7,9 +7,9 @@ #ifndef ACE_SCHEDULER_UTILITIES_H #define ACE_SCHEDULER_UTILITIES_H -#include <ace/OS.h> +#include "ace/OS.h" -#include "RtecSchedulerC.h" +#include "orbsvcs/RtecSchedulerC.h" class ACE_RT_Info : public RtecScheduler::RT_Info // = TITLE @@ -40,7 +40,7 @@ public: }; #if defined (__ACE_INLINE__) -#include "Scheduler_Utilities.i" +#include "orbsvcs/Scheduler_Utilities.i" #endif /* __ACE_INLINE__ */ #endif /* ACE_SCHEDULER_UTILITIES_H */ diff --git a/TAO/orbsvcs/lib/Scheduler_Utilities.i b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.i index 1d62ceffaf5..1d62ceffaf5 100644 --- a/TAO/orbsvcs/lib/Scheduler_Utilities.i +++ b/TAO/orbsvcs/orbsvcs/Scheduler_Utilities.i diff --git a/TAO/orbsvcs/tests/Event_Latency/Event_Latency.cpp b/TAO/orbsvcs/tests/Event_Latency/Event_Latency.cpp new file mode 100644 index 00000000000..8e27742b47d --- /dev/null +++ b/TAO/orbsvcs/tests/Event_Latency/Event_Latency.cpp @@ -0,0 +1,891 @@ +// $Id$ + +#include <limits.h> +#if defined (quantify) + #include <quantify.h> +#endif /* quantify */ + +#include "ace/Get_Opt.h" +#include "ace/Sched_Params.h" +#include "ace/Profile_Timer.h" + +#include "tao/Timeprobe.h" +#include "orbsvcs/Event_Utilities.h" +#include "orbsvcs/Event_Service_Constants.h" +#include "orbsvcs/Scheduler_Factory.h" +#include "orbsvcs/RtecEventChannelAdminC.h" +#include "Event_Latency.h" + +static const char usage [] = "[-? |\n" +" [-c <consumers> [4]]\n" +" [-d directly connect all consumers/suppliers\n" +" [-j to collect jitter statistics]\n" +" [-m <count> of messages to send [10]]\n" +" [-s <suppliers>, [1]]\n" +" [-t <timeout interval>, msec [250]]]"; + +// Configuration parameters. +static u_int consumers = 1; +static u_int suppliers = 1; +static u_int total_messages = 1000; +static int measure_jitter = 0; +static u_int timeout_interval = 250; // msec + +static int short_circuit_EC = 0; +static int shutting_down = 0; + +// This is global to allow the Supplier to short ciruit the EC +// and talk directly to consumers. For testing only :-) +static Latency_Consumer **consumer; + +// ************************************************************ + +Latency_Consumer::Latency_Consumer (const int measure_jitter) + : measure_jitter_ (measure_jitter), + min_latency_ (INT_MAX), + max_latency_ (INT_MIN), + total_latency_ (0), + total_pushes_ (0), + min_to_ec_ (INT_MAX), + max_to_ec_ (INT_MIN), + sum_to_ec_ (0), + min_in_ec_ (INT_MAX), + max_in_ec_ (INT_MIN), + sum_in_ec_ (0), + min_from_ec_ (INT_MAX), + max_from_ec_ (INT_MIN), + sum_from_ec_ (0) +{ +} + +int +Latency_Consumer::open_consumer (RtecEventChannelAdmin::EventChannel_ptr ec, + const char *my_name) +{ + entry_point (my_name); + ACE_TRY + { + RtecScheduler::Scheduler_ptr server = + ACE_Scheduler_Factory::server (); + + rt_info_ = + server->create (my_name, ACE_TRY_ENV); + server->set (rt_info_, + 1, 1, 1, 0, + RtecScheduler::VERY_LOW, + RtecScheduler::NO_QUANTUM, 1, + ACE_TRY_ENV); + + // Create the event that we're registering for. + ACE_ConsumerQOS_Factory dependencies; + dependencies.start_disjunction_group (); + dependencies.insert_type (ACE_ES_EVENT_NOTIFICATION, rt_info_); + dependencies.insert_type (ACE_ES_EVENT_SHUTDOWN, rt_info_); + + this->channel_admin_ = ec; + + // = Connect as a consumer. + consumer_admin_ = + RtecEventChannelAdmin::ConsumerAdmin::_duplicate(channel_admin_->for_consumers (ACE_TRY_ENV)); + ACE_CHECK_ENV; + suppliers_ = + RtecEventChannelAdmin::ProxyPushSupplier::_duplicate(consumer_admin_->obtain_push_supplier (ACE_TRY_ENV)); + ACE_CHECK_ENV; + suppliers_->connect_push_consumer (this, + dependencies.get_ConsumerQOS (), + ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCH (const ACE_EventChannel::SUBSCRIPTION_ERROR, se) + { + ACE_ERROR_RETURN ((LM_ERROR, + "Latency_Consumer::open: " + "subscribe failed.\n"), -1); + } + ACE_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, + "Latency_Consumer::open: " + "unexpected exception.\n"), -1); + } + ACE_ENDTRY; + + return 0; +} + +void +Latency_Consumer::disconnect_push_consumer (CORBA::Environment &) +{ + ACE_DEBUG ((LM_DEBUG, "Consumer received disconnect from channel.\n")); +} + +void +Latency_Consumer::push (const RtecEventComm::EventSet &events, + CORBA::Environment &) +{ + // ACE_DEBUG ((LM_DEBUG, "Latency_Consumer:push - ")); + ACE_TIMEPROBE ("push event to consumer"); + + if (events.length () == 0) + { + // ACE_DEBUG ((LM_DEBUG, "no events\n")); + return; + } + // ACE_DEBUG ((LM_DEBUG, "%d event(s)\n", events.length ())); + +#if defined (quantify) + // If measuring jitter, just Quantify the supplier-consumer path. + if (measure_jitter) + { + quantify_stop_recording_data (); + } +#endif /* quantify */ + + for (int i = 0; i < events.length (); ++i) + { + if (events[i].type_ == ACE_ES_EVENT_SHUTDOWN) + { + ACE_DEBUG ((LM_DEBUG, "Latency Consumer: received shutdown event\n")); + this->shutdown (); + } + else + { + if (measure_jitter_) + { + // @@ TOTAL HACK + ACE_hrtime_t creation; + ACE_OS::memcpy (&creation, &events[i].creation_time_, + sizeof (creation)); + + ACE_hrtime_t ec_recv; + ACE_OS::memcpy (&ec_recv, &events[i].ec_recv_time_, + sizeof (ec_recv)); + + ACE_hrtime_t ec_send; + ACE_OS::memcpy (&ec_send, &events[i].ec_send_time_, + sizeof (ec_send)); + + const ACE_hrtime_t now = ACE_OS::gethrtime (); + const ACE_hrtime_t elapsed = now - creation; + // Note: the division by 1 provides transparent support of + // ACE_U_LongLong. + ACE_Time_Value latency (elapsed / ACE_ONE_SECOND_IN_NSECS, + (elapsed / 1 % ACE_ONE_SECOND_IN_NSECS) / 1000); + + const ACE_hrtime_t to_ec_nsecs = ec_recv - creation; + ACE_Time_Value to_ec (to_ec_nsecs / ACE_ONE_SECOND_IN_NSECS, + (to_ec_nsecs / 1 % ACE_ONE_SECOND_IN_NSECS) / 1000); + + const ACE_hrtime_t in_ec_nsecs = ec_send - ec_recv; + ACE_Time_Value in_ec (in_ec_nsecs / ACE_ONE_SECOND_IN_NSECS, + (in_ec_nsecs / 1 % ACE_ONE_SECOND_IN_NSECS) / 1000); + + const ACE_hrtime_t from_ec_nsecs = now - ec_send; + ACE_Time_Value from_ec (from_ec_nsecs / ACE_ONE_SECOND_IN_NSECS, + (from_ec_nsecs / 1 % ACE_ONE_SECOND_IN_NSECS) / 1000); + + if (! shutting_down) + { + ++total_pushes_; + if (min_latency_ > latency) min_latency_ = latency; + if (max_latency_ < latency) max_latency_ = latency; + total_latency_ += latency; + if (min_to_ec_ > to_ec) min_to_ec_ = to_ec; + if (max_to_ec_ < to_ec) max_to_ec_ = to_ec; + sum_to_ec_ += to_ec; + if (min_in_ec_ > in_ec) min_in_ec_ = in_ec; + if (max_in_ec_ < in_ec) max_in_ec_ = in_ec; + sum_in_ec_ += in_ec; + if (min_from_ec_ > from_ec) min_from_ec_ = from_ec; + if (max_from_ec_ < from_ec) max_from_ec_ = from_ec; + sum_from_ec_ += from_ec; + } + } + } + + } +} + +void +Latency_Consumer::shutdown (void) +{ + ACE_DEBUG ((LM_DEBUG, "(%t) %s shutting down.\n", entry_point ())); + + ACE_TRY + { + // Disconnect from the push supplier. + suppliers_->disconnect_push_supplier (ACE_TRY_ENV); + ACE_CHECK_ENV; + + CORBA::release (suppliers_); + + ACE_DEBUG ((LM_DEBUG, "@@ we should shutdown here!!!\n")); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, + "(%t) %s Latency_Consumer::shutdown: unexpected exception.\n", + entry_point ())); + } + ACE_ENDTRY; +} + + +void +Latency_Consumer::print_stats () /* const */ +{ + if (measure_jitter_) + { + double lat_min = + (min_latency_.sec () * 1000000.0 + min_latency_.usec ()) / 1000.0; + double lat_max = + (max_latency_.sec () * 1000000.0 + max_latency_.usec ()) / 1000.0; + double lat_avg = + (total_latency_.sec () * 1000000.0 +total_latency_.usec ()) / total_pushes_ / 1000.0; + ACE_DEBUG ((LM_TRACE, + "%s: Latency in msec (min/max/avg): " + "%5.3f/%5.3f/%5.3f\n", + entry_point (), lat_min, lat_max, lat_avg)); + + double to_ec_min = + (min_to_ec_.sec () * 1000000.0 + min_to_ec_.usec ()) / 1000.0; + double to_ec_max = + (max_to_ec_.sec () * 1000000.0 + max_to_ec_.usec ()) / 1000.0; + double to_ec_avg = + (sum_to_ec_.sec () * 1000000.0 + sum_to_ec_.usec ()) / total_pushes_ / 1000.0; + ACE_DEBUG ((LM_TRACE, + "%s: From test to EC (min/max/avg): " + "%5.3f/%5.3f/%5.3f\n", + entry_point (), to_ec_min, to_ec_max, to_ec_avg)); + + double in_ec_min = + (min_in_ec_.sec () * 1000000.0 + min_in_ec_.usec ()) / 1000.0; + double in_ec_max = + (max_in_ec_.sec () * 1000000.0 + max_in_ec_.usec ()) / 1000.0; + double in_ec_avg = + (sum_in_ec_.sec () * 1000000.0 + sum_in_ec_.usec ()) / total_pushes_ / 1000.0; + ACE_DEBUG ((LM_TRACE, + "%s: In the EC (min/max/avg): " + "%5.3f/%5.3f/%5.3f\n", + entry_point (), in_ec_min, in_ec_max, in_ec_avg)); + + double from_ec_min = + (min_from_ec_.sec () * 1000000.0 + min_from_ec_.usec ()) / 1000.0; + double from_ec_max = + (max_from_ec_.sec () * 1000000.0 + max_from_ec_.usec ()) / 1000.0; + double from_ec_avg = + (sum_from_ec_.sec () * 1000000.0 + sum_from_ec_.usec ()) / total_pushes_ / 1000.0; + ACE_DEBUG ((LM_TRACE, + "%s: From EC to test (min/max/avg): " + "%5.3f/%5.3f/%5.3f\n", + entry_point (), from_ec_min, from_ec_max, from_ec_avg)); + + } +} + + +// ************************************************************ + +Latency_Supplier::Supplier::Supplier (Latency_Supplier* impl) + : impl_ (impl) +{ +} + +void Latency_Supplier::Supplier::disconnect_push_supplier + (CORBA::Environment &_env) +{ + this->impl_->disconnect_push_supplier (_env); +} + +Latency_Supplier::Consumer::Consumer (Latency_Supplier* impl) + : impl_ (impl) +{ +} + +void Latency_Supplier::Consumer::disconnect_push_consumer + (CORBA::Environment &_env) +{ + this->impl_->disconnect_push_consumer (_env); +} + +void Latency_Supplier::Consumer::push + (const RtecEventComm::EventSet &events, + CORBA::Environment &_env) +{ + this->impl_->push (events, _env); +} + +// ************************************************************ + +Latency_Supplier::Latency_Supplier (const u_int total_messages, + CORBA::Long supplier_id, + const int timestamp) + : total_messages_ (total_messages), + supplier_id_ (supplier_id), + timestamp_ (timestamp), + total_sent_ (0), + master_ (0), + supplier_ (new Supplier (this)), + consumer_ (new Consumer (this)) +{ + CORBA::Object::_duplicate (this->supplier_); + CORBA::Object::_duplicate (this->consumer_); +} + +Latency_Supplier::~Latency_Supplier (void) +{ + CORBA::release (this->supplier_); + CORBA::release (this->consumer_); +} + +int +Latency_Supplier::open_supplier (RtecEventChannelAdmin::EventChannel_ptr ec, + const char *name, int master) +{ + this->entry_point (name); + master_ = master; + ACE_TRY + { + RtecScheduler::Scheduler_ptr server = + ACE_Scheduler_Factory::server (); + + rt_info_ = + server->create (name, ACE_TRY_ENV); + + server->set (rt_info_, 1, 1, 1, timeout_interval * 10000, + RtecScheduler::VERY_LOW, + RtecScheduler::NO_QUANTUM, 1, + ACE_TRY_ENV); + +#if 0 + SUPPLIER_NS::RegisterService + (entry_point (), + // ACE_Naming::NOBJECT, + NOBJECT, this); +#endif /* 0 */ + + ACE_SupplierQOS_Factory publications; + publications.insert (supplier_id_, + ACE_ES_EVENT_NOTIFICATION, + rt_info_, 1); + publications.insert (supplier_id_, + ACE_ES_EVENT_SHUTDOWN, + rt_info_, 1); + + this->channel_admin_ = ec; + + // = Connect as a supplier. + supplier_admin_ = + RtecEventChannelAdmin::SupplierAdmin::_duplicate(channel_admin_->for_suppliers (ACE_TRY_ENV)); + ACE_CHECK_ENV; + consumers_ = + RtecEventChannelAdmin::ProxyPushConsumer::_duplicate(supplier_admin_->obtain_push_consumer (ACE_TRY_ENV)); + ACE_CHECK_ENV; + + consumers_->connect_push_supplier (this->supplier_, + publications.get_SupplierQOS (), + ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_TRY_ENV.print_exception ("Latency_Supplier::open"); + return -1; + } + ACE_ENDTRY; + + return 0; +} + +void +Latency_Supplier::disconnect_push_consumer (CORBA::Environment &) +{ + ACE_DEBUG ((LM_DEBUG, "Supplier-consumer received disconnect from channel.\n")); +} + +void +Latency_Supplier::disconnect_push_supplier (CORBA::Environment &) +{ + ACE_DEBUG ((LM_DEBUG, "Supplier received disconnect from channel.\n")); +} + +int +Latency_Supplier::start_generating_events (void) +{ + const ACE_hrtime_t now = ACE_OS::gethrtime (); + test_start_time_.set (now / 1000000000, (now / 1 % 1000000000) / 1000); + + ACE_TRY + { + ACE_ConsumerQOS_Factory dependencies; + dependencies.start_disjunction_group (); + dependencies.insert_time (ACE_ES_EVENT_INTERVAL_TIMEOUT, + timeout_interval * 10000, + rt_info_); + if (!master_) + dependencies.insert_type (ACE_ES_EVENT_SHUTDOWN, rt_info_); + + // = Connect as a consumer. + consumer_admin_ = + RtecEventChannelAdmin::ConsumerAdmin::_duplicate(channel_admin_->for_consumers (ACE_TRY_ENV)); + ACE_CHECK_ENV; + suppliers_ = + RtecEventChannelAdmin::ProxyPushSupplier::_duplicate(consumer_admin_->obtain_push_supplier (ACE_TRY_ENV)); + ACE_CHECK_ENV; + + suppliers_->connect_push_consumer (this->consumer_, + dependencies.get_ConsumerQOS (), + ACE_TRY_ENV); + ACE_CHECK_ENV; + } + ACE_CATCHANY + { + ACE_ERROR_RETURN ((LM_ERROR, + "Latency_Supplier::generate_events:" + " unexpected exception.\n"), -1); + } + ACE_ENDTRY; + + return 0; +} + +void +Latency_Supplier::push (const RtecEventComm::EventSet &events, + CORBA::Environment & _env) +{ + // ACE_DEBUG ((LM_DEBUG, "Latency_Supplier::push - ")); + + if (events.length () == 0) + { + // ACE_DEBUG ((LM_DEBUG, "no events\n")); + return; + } + + // ACE_DEBUG ((LM_DEBUG, "%d event(s)\n", events.length ())); + + for (int i = 0; i < events.length (); ++i) + { + if (!master_ && events[i].type_ == ACE_ES_EVENT_SHUTDOWN) + { + ACE_DEBUG ((LM_DEBUG, "Latency Supplier: received shutdown event\n")); + this->shutdown (); + } + else if (events[i].type_ == ACE_ES_EVENT_INTERVAL_TIMEOUT) + { + // Create the event to send. + RtecEventComm::Event event; + event.source_ = supplier_id_; + event.type_ = ACE_ES_EVENT_NOTIFICATION; + ++total_sent_; + + if (timestamp_) + { + // @@ David, event.time_ is now a long. I'm not sure if + // this calculation is correct now. For the moment beign + // I use a global variable instead. + // const ACE_hrtime_t now = ACE_OS::gethrtime (); + // event.time_.set (now / ACE_ONE_SECOND_IN_NSECS, + // (now % ACE_ONE_SECOND_IN_NSECS) / 1000); + + // @@ TOTAL HACK + // event_push_time = ACE_OS::gethrtime (); + ACE_hrtime_t t = ACE_OS::gethrtime (); + ACE_OS::memcpy (&event.creation_time_, &t, + sizeof (event.creation_time_)); + } + + // @@ ACE_TIMEPROBE_RESET; + // @@ ACE_TIMEPROBE ("start with new event in Supplier"); + + ACE_TRY + { + if (short_circuit_EC) + { + for (u_int cons = 0; cons < consumers; ++cons) + { + // This constructor is fast. + const RtecEventComm::EventSet es (1, 1, &event); + consumer [cons]->push (es, ACE_TRY_ENV); + } + } + else + { +#if defined (quantify) + // If measuring jitter, just Quantify the supplier-consumer path. + if (measure_jitter) + { + quantify_start_recording_data (); + } +#endif /* quantify */ + + ACE_TIMEPROBE (" supplier starts pushing event"); + + RtecEventComm::EventSet events (1); + events.length (1); + events[0] = event; + consumers_->push (events, ACE_TRY_ENV); + + ACE_TIMEPROBE (" supplier ends pushing event"); + } + ACE_CHECK_ENV; + } + ACE_CATCH (RtecEventComm::Disconnected, d) + { + ACE_ERROR ((LM_ERROR, "(%t) Latency_Supplier::push: disconnected.\n")); + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "(%t) %s Latency_Supplier::push:" + " unexpected exception.\n", + entry_point ())); + } + ACE_ENDTRY; + + // Check if we're done. + if (master_ && (total_sent_ >= total_messages_)) + this->shutdown (); + } + else + { + ACE_ERROR ((LM_ERROR, "(%t) %s received unexpected events: ", + entry_point ())); + // ::dump_sequence (events); + return; + } + } +} + +void +Latency_Supplier::shutdown (void) +{ + shutting_down = 1; + + #if defined (quantify) + // Need to stop recording here even if testing for jitter, because + // recording is still probably enabled. + quantify_stop_recording_data (); + if (! measure_jitter) + { + ACE_DEBUG ((LM_DEBUG, "(%t) stopped Quantify recording\n")); + } + #endif /* quantify */ + + const ACE_hrtime_t now = ACE_OS::gethrtime (); + test_stop_time_.set (now / ACE_ONE_SECOND_IN_NSECS, + (now / 1 % ACE_ONE_SECOND_IN_NSECS) / 1000); + + static int total_iterations = 1; + if (--total_iterations > 0) + { + total_sent_ = 0; + return; + } + + ACE_TRY + { + if (master_) + { + // Create the shutdown message. + RtecEventComm::Event event; + event.source_ = supplier_id_; + event.type_ = ACE_ES_EVENT_SHUTDOWN; + + // Push the shutdown event. + RtecEventComm::EventSet events (1); + events.length (1); + events[0] = event; + consumers_->push (events, ACE_TRY_ENV); + ACE_CHECK_ENV; + } + + // Disconnect from the channel. + consumers_->disconnect_push_consumer (ACE_TRY_ENV); + ACE_CHECK_ENV; + + // Disconnect from the push supplier. + suppliers_->disconnect_push_supplier (ACE_TRY_ENV); + ACE_CHECK_ENV; + + if (master_) + { + // @@ TODO: Do this portably (keeping the ORB_ptr returned from + // ORB_init) + channel_admin_->destroy (ACE_TRY_ENV); + ACE_CHECK_ENV; + + TAO_ORB_Core_instance ()->orb ()->shutdown (); + } + } + ACE_CATCHANY + { + ACE_ERROR ((LM_ERROR, "(%t) %s Latency_Supplier::shutdown:" + " unexpected exception.\n", + entry_point ())); + ACE_TRY_ENV.print_exception ("Latency_Supplier::shutdown"); + } + ACE_ENDTRY; +} + + +void +Latency_Supplier::print_stats () /* const */ +{ + ACE_Time_Value test_elapsed_time (test_stop_time_ - test_start_time_); + const u_int elapsed = test_elapsed_time.sec () * 1000000 + + test_elapsed_time.usec (); // usec + + ACE_DEBUG ((LM_TRACE, + "%s: delivered %u events to %u consumer(s) in %u msec;\n" + " per-event average was %8.3f msec.\n", + entry_point (), + total_sent_, + consumers / suppliers + consumers % suppliers, + elapsed / 1000, + (double) elapsed / total_sent_ / 1000.0)); +} + + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// function get_options +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +static +unsigned int +get_options (int argc, char *argv []) +{ + ACE_Get_Opt get_opt (argc, argv, "Oc:djm:s:t:?"); + int opt; + int temp; + + while ((opt = get_opt ()) != EOF) + { + switch (opt) { + case 'c': + if ((temp = ACE_OS::atoi (get_opt.optarg)) > 0) + { + consumers = (u_int) temp; + } + else + { + ACE_ERROR_RETURN ((LM_ERROR, + "%s: number of consumers must be > 0", + argv[0]), 1); + } + break; + case 'd': + short_circuit_EC = 1; + break; + case 'j': + measure_jitter = 1; + break; + case 'm': + if ((temp = ACE_OS::atoi (get_opt.optarg)) > 0) + { + total_messages = (u_int) temp; + } + else + { + ACE_ERROR_RETURN ((LM_ERROR, + "%s: count must be > 0", + argv[0]), 1); + } + break; + case 's': + if ((temp = ACE_OS::atoi (get_opt.optarg)) > 0) + { + suppliers = (u_int) temp; + } + else + { + ACE_ERROR_RETURN ((LM_ERROR, + "%s: number of suppliers must be > 0", + argv[0]), 1); + } + break; + case 't': + if (ACE_OS::atoi (get_opt.optarg) >= 0) + { + timeout_interval = ACE_OS::atoi (get_opt.optarg); + } + else + { + ACE_ERROR_RETURN ((LM_ERROR, + "%s: timeout must be >= 0", + argv[0]), 1); + } + break; + case '?': + ACE_DEBUG ((LM_DEBUG, + "Usage: %s %s\n", + argv[0], usage)); + ACE_OS::exit (0); + break; + default: + ACE_ERROR_RETURN ((LM_ERROR, + "%s: unknown arg, -%c\n" + "Usage: %s %s\n", + argv[0], char(opt), + argv[0], usage), 1); + } + } + + if (argc != get_opt.optind) + { + ACE_ERROR_RETURN ((LM_ERROR, + "%s: too many arguments\n" + "Usage: %s %s\n", + argv[0], argv[0], usage), 1); + } + + return 0; +} + +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +// function main +/////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////// +int +main (int argc, char *argv []) +{ + if (ACE_OS::sched_params ( + ACE_Sched_Params ( + ACE_SCHED_FIFO, + ACE_Sched_Params::priority_min (ACE_SCHED_FIFO), + ACE_SCOPE_PROCESS)) != 0) + { + if (ACE_OS::last_error () == EPERM) + { + ACE_DEBUG ((LM_MAX, "Latency: user is not superuser, " + "so remain in time-sharing class\n")); + } + else + { + ACE_DEBUG ((LM_ERROR, "%p\n", "Latency")); + ACE_OS::exit (-1); + } + } + + u_int i; + + ACE_TRY + { + // Initialize ORB. + CORBA::ORB_ptr orb = + CORBA::ORB_init (argc, argv, "internet", ACE_TRY_ENV); + ACE_CHECK_ENV; + + CORBA::POA_ptr poa = + orb->POA_init(argc, argv, "POA"); + + if (get_options (argc, argv)) + ACE_OS::exit (-1); + + + + CORBA::Object_ptr objref = + orb->resolve_initial_references ("NameService"); + ACE_CHECK_ENV; + CosNaming::NamingContext_var naming_context = + CosNaming::NamingContext::_narrow (objref, ACE_TRY_ENV); + ACE_CHECK_ENV; + + ACE_Scheduler_Factory::use_config (naming_context.ptr ()); + + // Allocate the timeprobe instance now, so we don't measure + // the cost of doing it later. + ACE_TIMEPROBE_RESET; + + CosNaming::Name channel_name (1); + channel_name[0].id = CORBA::string_dup ("EventService"); + channel_name.length (1); + + CORBA::Object_ptr ec_ptr = + naming_context->resolve (channel_name, ACE_TRY_ENV); + ACE_CHECK_ENV; + RtecEventChannelAdmin::EventChannel_var ec = + RtecEventChannelAdmin::EventChannel::_narrow (ec_ptr, ACE_TRY_ENV); + ACE_CHECK_ENV; + + // Create supplier(s). + Latency_Supplier **supplier; + ACE_NEW_RETURN (supplier, Latency_Supplier *[suppliers], -1); + for (i = 0; i < suppliers; ++i) + { + int supplier_timestamps = (i==0); + ACE_NEW_RETURN (supplier [i], + Latency_Supplier (total_messages, + measure_jitter, + supplier_timestamps), + -1); + char supplier_name [BUFSIZ]; + sprintf (supplier_name, "supplier-%d", i+1); + // Only the first supplier timestamps its messages. + int master = (i==0); + if (supplier [i]->open_supplier (ec.ptr (), + supplier_name, + master) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "Supplier open failed.\n"), -1); + } + + // Create consumers. + ACE_NEW_RETURN (consumer, Latency_Consumer *[consumers], -1); + for (i = 0; i < consumers; ++i) + { + ACE_NEW_RETURN (consumer [i], Latency_Consumer (measure_jitter), -1); + RtecEventComm::PushConsumer::_duplicate (consumer[i]); + char buf [BUFSIZ]; + sprintf (buf, "consumer-%d", i+1); + + if (consumer [i]->open_consumer (ec.ptr (), buf) == -1) + ACE_ERROR_RETURN ((LM_ERROR, "Someone was feeling introverted.\n"), + -1); + } + + #if defined (quantify) + if (! measure_jitter) + { + ACE_DEBUG ((LM_DEBUG, "(%t) start Quantify recording\n")); + quantify_start_recording_data (); + } + #endif /* quantify */ + + // Tell supplier(s) to generate events. + for (i = 0; i < suppliers; ++i) + { + if (supplier [i]->start_generating_events () == -1) + ACE_ERROR_RETURN ((LM_ERROR, "generate_events failed.\n"), -1); + } + + orb->run (); + + for (i = 0; i < suppliers; ++i) + { + supplier [i]->print_stats (); + delete supplier[i]; + ACE_CHECK_ENV; + } + delete [] supplier; + + for (i = 0; i < consumers; ++i) + { + consumer [i]->print_stats (); + CORBA::release (consumer [i]); + ACE_CHECK_ENV; + } + delete [] consumer; + + ACE_TIMEPROBE_PRINT; + ACE_TIMEPROBE_FINI; + } + ACE_CATCH (CORBA::SystemException, sys_ex) + { + ACE_TRY_ENV.print_exception ("SYS_EX"); + } + ACE_ENDTRY; + + + return 0; +} diff --git a/TAO/orbsvcs/tests/Event_Latency/Event_Latency.h b/TAO/orbsvcs/tests/Event_Latency/Event_Latency.h new file mode 100644 index 00000000000..f722eff644a --- /dev/null +++ b/TAO/orbsvcs/tests/Event_Latency/Event_Latency.h @@ -0,0 +1,250 @@ +/* -*- C++ -*- */ +// $Id$ +// +// ============================================================================ +// +// = LIBRARY +// ACE Event Service Benchmarks +// +// = FILENAME +// Latency.h +// +// = AUTHOR +// David Levine (levine@cs.wustl.edu) and +// Tim Harrison (harrison@cs.wustl.edu) +// +// = DESCRIPTION +// +// ============================================================================ + +#if !defined (EVENT_LATENCY_H) +#define EVENT_LATENCY_H + +#include "ace/SString.h" +#include "orbsvcs/RtecEventChannelAdminC.h" +#include "orbsvcs/RtecEventCommS.h" + +class Latency_Consumer : public POA_RtecEventComm::PushConsumer +// = TITLE +// Latency Consumer +// +// = DESCRIPTION +// Simple example of a consumer that registers for supplier +// notifications. +{ +public: + Latency_Consumer (const int measure_jitter = 0); + // Construction. The default of not measuring jitter provides + // a "null" push routine, for measuring aggregate timing. + + int open_consumer (RtecEventChannelAdmin::EventChannel_ptr ec, + const char *my_name); + // Uses the name server to obtain a reference to the <supplier_name> + // and registers with channel to receive notifications from the + // supplier. Also registers to receive shutdown messages from the + // supplier. Stores <my_name> for printing out messages. Returns 0 + // on success, -1 on failure. + + virtual void disconnect_push_consumer (CORBA::Environment &); + // The channel is disconnecting. + + void entry_point (const char*); + const char *entry_point () const; + + void print_stats () /* const */; + // Print timing statistics. + +// (not protected to allow short-circuiting) protected: + virtual void push (const RtecEventComm::EventSet &events, + CORBA::Environment &); + // If the <events>[0] is a notification, prints out the data from + // the supplier. If its a shutdown message, the consumer + // disconnects from the channel. + +protected: + void shutdown (void); + // Disconnect from the Event Service. + + // = Event channel adminstration references. + RtecEventChannelAdmin::EventChannel_var channel_admin_; + RtecEventChannelAdmin::ConsumerAdmin_ptr consumer_admin_; + RtecEventChannelAdmin::ProxyPushSupplier_ptr suppliers_; + +private: + RtecScheduler::handle_t rt_info_; + + int measure_jitter_; + + ACE_Time_Value min_latency_; + ACE_Time_Value max_latency_; + ACE_Time_Value total_latency_; + u_long total_pushes_; + // Registers and counters for keeping track of latency statistics. + + ACE_Time_Value min_to_ec_; + ACE_Time_Value max_to_ec_; + ACE_Time_Value sum_to_ec_; + // Statitics on time to get to the EC. + + ACE_Time_Value min_in_ec_; + ACE_Time_Value max_in_ec_; + ACE_Time_Value sum_in_ec_; + // Statitics on time spent in the EC. + + ACE_Time_Value min_from_ec_; + ACE_Time_Value max_from_ec_; + ACE_Time_Value sum_from_ec_; + // Statitics on time spent since the EC put the event on the wire + // and it gets here. + + ACE_CString entry_point_; +}; + +// ************************************************************ + +class Latency_Supplier +// = TITLE +// Latency Supplier +// +// = DESCRIPTION +// Generates event nofications and a shutdown message. +{ +public: + + // + // This class provides IS-A Consumer and Supplier of events. But + // inheritance from two skeleton classes is non-complaint (or at + // least won't work with TAO). We use smaller implementation classes + // that delegate on Latency_Supplier to do the job. + // + class Supplier : public POA_RtecEventComm::PushSupplier { + public: + virtual void disconnect_push_supplier (CORBA::Environment &); + // The channel is disconnecting. + + private: + Supplier (Latency_Supplier* impl); + friend class Latency_Supplier; + + private: + Latency_Supplier* impl_; + }; + + class Consumer : public POA_RtecEventComm::PushConsumer { + public: + virtual void push (const RtecEventComm::EventSet &events, + CORBA::Environment &); + // The channel pushed some events to us. + + virtual void disconnect_push_consumer (CORBA::Environment &); + // The channel is disconnecting. + + private: + Consumer (Latency_Supplier* impl); + friend class Latency_Supplier; + + private: + Latency_Supplier* impl_; + }; + + Latency_Supplier (const u_int total_messages, + CORBA::Long supplier_id, + const int timestamp = 0); + // Construction. Requires the total number of messages to be + // sent. If the timestamp flag is enabled, then events are + // timestamped, e.g., for use in measuring jitter. + + ~Latency_Supplier (void); + + int open_supplier (RtecEventChannelAdmin::EventChannel_ptr event_channel, + const char *name, int master); + // Registers with the name server under the given <name>. Also + // connects to the Event Channel as a supplier of notifications and + // shutdown messages. If <master> != 0, then the supplier will + // destroy the channel upon shutting down. Returns 0 on success, -1 + // on failure. + + void disconnect_push_supplier (CORBA::Environment &); + // The channel is disconnecting. + + void disconnect_push_consumer (CORBA::Environment &); + // The channel is disconnecting. + + void push (const RtecEventComm::EventSet &events, + CORBA::Environment &); + // Takes a timestamp and then pushes event_ to all consumers, either + // directly, or via a channel. + + int start_generating_events (void); + // Called when the supplier should start generating events. + // Registers with the Event Channel to receive timeouts every .25 + // seconds. Will generate some number of events and then send a + // shutdown message. Returns 0 on success, -1 on failure. + + void entry_point (const char *); + const char *entry_point () const; + + void print_stats () /* const */; + // Print timing statistics. + +protected: + + void shutdown (void); + // Disconnect from the Event Service. + + // = Event Channel adminstration references. + RtecEventChannelAdmin::EventChannel_var channel_admin_; + RtecEventChannelAdmin::ConsumerAdmin_var consumer_admin_; + RtecEventChannelAdmin::ProxyPushConsumer_var consumers_; + RtecEventChannelAdmin::SupplierAdmin_var supplier_admin_; + RtecEventChannelAdmin::ProxyPushSupplier_var suppliers_; + +private: + RtecScheduler::handle_t rt_info_; + + u_int total_messages_; + // How many events to push before ending the test. + + CORBA::Long supplier_id_; + // Our supplier ID. + + int timestamp_; + // Flag indicating whether or not to timestamp outgoing events. + + u_int total_sent_; + // How many events we've pushed. + + ACE_Time_Value test_start_time_; + ACE_Time_Value test_stop_time_; + // Start/stop times, marking the time period when events are + // sent to consumers. + + int master_; + + ACE_CString entry_point_; + + Supplier* supplier_; + Consumer* consumer_; +}; + +void Latency_Consumer::entry_point(const char* s) +{ + entry_point_ = s; +} + +const char* Latency_Consumer::entry_point (void) const +{ + return entry_point_.fast_rep (); +} + +void Latency_Supplier::entry_point(const char* s) +{ + entry_point_ = s; +} + +const char* Latency_Supplier::entry_point (void) const +{ + return entry_point_.fast_rep (); +} + +#endif /* EVENT_LATENCY_H */ diff --git a/TAO/orbsvcs/tests/Event_Latency/Makefile b/TAO/orbsvcs/tests/Event_Latency/Makefile new file mode 100644 index 00000000000..e847f4d9e53 --- /dev/null +++ b/TAO/orbsvcs/tests/Event_Latency/Makefile @@ -0,0 +1,261 @@ +# +# $Id$ +# + +BIN = Event_Latency + +BUILD = $(BIN) + +EVENT_LATENCY_SRCS= \ + Event_Latency.cpp + +LSRC= \ + $(EVENT_LATENCY_SRCS) \ + +EVENT_LATENCY_OBJS = $(EVENT_LATENCY_SRCS:.cpp=.o) + +LDLIBS= -lorbsvcs -lTAO + +#---------------------------------------------------------------------------- +# Include macros and targets +#---------------------------------------------------------------------------- + +include $(ACE_ROOT)/include/makeinclude/wrapper_macros.GNU +include $(ACE_ROOT)/include/makeinclude/macros.GNU +include $(ACE_ROOT)/include/makeinclude/rules.common.GNU +include $(ACE_ROOT)/include/makeinclude/rules.nonested.GNU +include $(ACE_ROOT)/include/makeinclude/rules.local.GNU + +#### compiler-specific options +ifeq ($(CXX),g++) + CCFLAGS += -pedantic +else +ifeq ($(CXX),CC) +endif +endif + +ifdef quantify + CCFLAGS += -Dquantify + CPPFLAGS += -I/pkg/purify/quantify-2.1-solaris2 +endif # quantify + +#### Local rules and variables... + +ifndef TAO_ROOT +TAO_ROOT = $(ACE_ROOT)/TAO +endif +TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE +DCFLAGS = -g +LDFLAGS += -L$(TAO_ROOT)/orbsvcs/orbsvcs -L$(TAO_ROOT)/tao +CPPFLAGS += -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H + +# Leave the scheduler output out if this is a config run. +ifneq ($(config),1) +EVENT_LATENCY_CONFIG_OBJS=Event_Latency_Scheduler_Runtime.o +endif # config + +ifeq ($(probe),1) + CCFLAGS += -DACE_ENABLE_TIMEPROBES +endif # probe + +Event_Latency: $(addprefix $(VDIR),$(EVENT_LATENCY_OBJS) $(EVENT_LATENCY_CONFIG_OBJS)) + $(LINK.cc) $(LDFLAGS) -o $@ $^ $(VLDLIBS) + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + +.obj/Event_Latency.o .shobj/Event_Latency.: Event_Latency.cpp \ + $(ACE_ROOT)/ace/Get_Opt.h \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/config.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Record.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/Log_Record.i \ + $(ACE_ROOT)/ace/Version.h \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Get_Opt.i \ + $(ACE_ROOT)/ace/Sched_Params.h \ + $(ACE_ROOT)/ace/Sched_Params.i \ + $(ACE_ROOT)/ace/Profile_Timer.h \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/High_Res_Timer.h \ + $(ACE_ROOT)/ace/High_Res_Timer.i \ + $(ACE_ROOT)/ace/Profile_Timer.i \ + $(TAO_ROOT)/tao/Timeprobe.h \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.h \ + $(ACE_ROOT)/ace/SV_Semaphore_Simple.i \ + $(ACE_ROOT)/ace/SV_Semaphore_Complex.i \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Atomic_Op.i \ + $(TAO_ROOT)/tao/Timeprobe.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Utilities.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.h \ + $(TAO_ROOT)/tao/corba.h \ + $(ACE_ROOT)/ace/SOCK_Stream.h \ + $(ACE_ROOT)/ace/SOCK_IO.h \ + $(ACE_ROOT)/ace/SOCK.h \ + $(ACE_ROOT)/ace/Addr.h \ + $(ACE_ROOT)/ace/Addr.i \ + $(ACE_ROOT)/ace/IPC_SAP.h \ + $(ACE_ROOT)/ace/IPC_SAP.i \ + $(ACE_ROOT)/ace/SOCK.i \ + $(ACE_ROOT)/ace/SOCK_IO.i \ + $(ACE_ROOT)/ace/INET_Addr.h \ + $(ACE_ROOT)/ace/INET_Addr.i \ + $(ACE_ROOT)/ace/SOCK_Stream.i \ + $(ACE_ROOT)/ace/Hash_Map_Manager.h \ + $(ACE_ROOT)/ace/SString.h \ + $(ACE_ROOT)/ace/SString.i \ + $(ACE_ROOT)/ace/SOCK_Acceptor.h \ + $(ACE_ROOT)/ace/SOCK_Acceptor.i \ + $(ACE_ROOT)/ace/SOCK_Connector.h \ + $(ACE_ROOT)/ace/SOCK_Connector.i \ + $(ACE_ROOT)/ace/Strategies.h \ + $(ACE_ROOT)/ace/Strategies_T.h \ + $(ACE_ROOT)/ace/Service_Config.h \ + $(ACE_ROOT)/ace/Service_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.h \ + $(ACE_ROOT)/ace/Shared_Object.i \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Signal.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Signal.i \ + $(ACE_ROOT)/ace/Object_Manager.h \ + $(ACE_ROOT)/ace/Object_Manager.i \ + $(ACE_ROOT)/ace/Managed_Object.h \ + $(ACE_ROOT)/ace/Managed_Object.i \ + $(ACE_ROOT)/ace/Service_Config.i \ + $(ACE_ROOT)/ace/Reactor.h \ + $(ACE_ROOT)/ace/Handle_Set.h \ + $(ACE_ROOT)/ace/Handle_Set.i \ + $(ACE_ROOT)/ace/Timer_Queue.h \ + $(ACE_ROOT)/ace/Timer_Queue_T.h \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Timer_Queue_T.i \ + $(ACE_ROOT)/ace/Reactor.i \ + $(ACE_ROOT)/ace/Reactor_Impl.h \ + $(ACE_ROOT)/ace/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Synch_Options.h \ + $(ACE_ROOT)/ace/Connector.h \ + $(ACE_ROOT)/ace/Map_Manager.h \ + $(ACE_ROOT)/ace/Map_Manager.i \ + $(ACE_ROOT)/ace/Svc_Handler.h \ + $(ACE_ROOT)/ace/Task.h \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread_Manager.i \ + $(ACE_ROOT)/ace/Task.i \ + $(ACE_ROOT)/ace/Task_T.h \ + $(ACE_ROOT)/ace/Message_Queue.h \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Malloc.h \ + $(ACE_ROOT)/ace/Malloc.i \ + $(ACE_ROOT)/ace/Malloc_T.h \ + $(ACE_ROOT)/ace/Malloc_T.i \ + $(ACE_ROOT)/ace/Memory_Pool.h \ + $(ACE_ROOT)/ace/Mem_Map.h \ + $(ACE_ROOT)/ace/Mem_Map.i \ + $(ACE_ROOT)/ace/Memory_Pool.i \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/IO_Cntl_Msg.h \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Dynamic.h \ + $(ACE_ROOT)/ace/Dynamic.i \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Svc_Handler.i \ + $(ACE_ROOT)/ace/Connector.i \ + $(ACE_ROOT)/ace/Acceptor.h \ + $(ACE_ROOT)/ace/Acceptor.i \ + $(TAO_ROOT)/tao/compat/objbase.h \ + $(TAO_ROOT)/tao/compat/initguid.h \ + $(TAO_ROOT)/tao/orbconf.h \ + $(TAO_ROOT)/tao/orb.h \ + $(TAO_ROOT)/tao/corbacom.h \ + $(TAO_ROOT)/tao/object.h \ + $(TAO_ROOT)/tao/align.h \ + $(TAO_ROOT)/tao/sequence.h \ + $(TAO_ROOT)/tao/varout.h \ + $(TAO_ROOT)/tao/any.h \ + $(TAO_ROOT)/tao/poa.h \ + $(TAO_ROOT)/tao/params.h \ + $(TAO_ROOT)/tao/client_factory.h \ + $(TAO_ROOT)/tao/server_factory.h \ + $(TAO_ROOT)/tao/default_client.h \ + $(TAO_ROOT)/tao/default_server.h \ + $(TAO_ROOT)/tao/except.h \ + $(TAO_ROOT)/tao/orbobj.h \ + $(TAO_ROOT)/tao/nvlist.h \ + $(TAO_ROOT)/tao/principa.h \ + $(TAO_ROOT)/tao/request.h \ + $(TAO_ROOT)/tao/svrrqst.h \ + $(TAO_ROOT)/tao/typecode.h \ + $(TAO_ROOT)/tao/marshal.h \ + $(TAO_ROOT)/tao/cdr.h \ + $(TAO_ROOT)/tao/stub.h \ + $(TAO_ROOT)/tao/connect.h \ + $(TAO_ROOT)/tao/orb_core.h \ + $(TAO_ROOT)/tao/objtable.h \ + $(TAO_ROOT)/tao/optable.h \ + $(TAO_ROOT)/tao/debug.h \ + $(TAO_ROOT)/tao/managed_types.h \ + $(TAO_ROOT)/tao/iiopobj.h \ + $(TAO_ROOT)/tao/iioporb.h \ + $(TAO_ROOT)/tao/giop.h \ + $(TAO_ROOT)/tao/orb_core.i \ + $(ACE_ROOT)/ace/Dynamic_Service.h \ + $(TAO_ROOT)/tao/corbacom.i \ + $(TAO_ROOT)/tao/sequence.i \ + $(TAO_ROOT)/tao/typecode.i \ + $(TAO_ROOT)/tao/any.i \ + $(TAO_ROOT)/tao/stub.i \ + $(TAO_ROOT)/tao/object.i \ + $(TAO_ROOT)/tao/orbobj.i \ + $(TAO_ROOT)/tao/marshal.i \ + $(TAO_ROOT)/tao/cdr.i \ + $(TAO_ROOT)/tao/poa.i \ + $(TAO_ROOT)/tao/giop.i \ + $(TAO_ROOT)/tao/iioporb.i \ + $(TAO_ROOT)/tao/iiopobj.i \ + $(TAO_ROOT)/tao/managed_types.i \ + $(TAO_ROOT)/tao/params.i \ + $(TAO_ROOT)/tao/server_factory.i \ + $(TAO_ROOT)/tao/default_client.i \ + $(TAO_ROOT)/tao/default_server.i \ + $(TAO_ROOT)/tao/connect.i \ + $(TAO_ROOT)/tao/singletons.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecSchedulerC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventChannelAdminC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Service_Constants.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Event_Utilities.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/CosNamingC.i \ + $(TAO_ROOT)/orbsvcs/orbsvcs/Scheduler_Factory.i \ + Event_Latency.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.h \ + $(TAO_ROOT)/orbsvcs/orbsvcs/RtecEventCommS.i + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/Event_Latency/svc.conf b/TAO/orbsvcs/tests/Event_Latency/svc.conf new file mode 100644 index 00000000000..43c6a486c92 --- /dev/null +++ b/TAO/orbsvcs/tests/Event_Latency/svc.conf @@ -0,0 +1,49 @@ +# $Id$ +# +# This file contains a sample ACE_Service_Config configuration +# file specifying the strategy factories utilized by an application +# using TAO. There are currently only two possible factories: +# Client_Strategy_Factory and Server_Strategy_Factory. These names +# must be used as the second argument to their corresponding line, +# because that's what the ORB uses to find the desired factory. +# +# Note that there are two unordinary characteristics of the way *this* +# file is set up: +# - both client and server strategies are specified in the same +# file, which would only make sense for co-located clients & servers +# - both of the factories are actually sourced out of libTAO.so +# (TAO.DLL on Win32), and they would normally be in a separate +# dll from the TAO ORB Core. +# +# The options which can be passed to the Resource Factory are: +# +# -ORBresources <which> +# where <which> can be 'global' to specify globally-held resources, +# or 'tss' to specify thread-specific resources. +# +# The options which can be passed to the Client are: +# <none currently> +# +# The options which can be passed to the Server are: +# +# -ORBconcurrency <which> +# where <which> can be 'thread-per-connection' to specify +# use of the ACE_Threaded_Strategy concurrency strategy, +# or 'reactive' to specify use of the ACE_Reactive_Strategy +# concurrency strategy. +# +# -ORBthreadflags <flags> +# specifies the default thread flags to use, where <flags> is a +# logical OR'ing of the flags THR_DETACHED, THR_BOUND, THR_NEW_LWP, +# THR_SUSPENDED, or THR_DAEMON. Note that not every flag may be valid +# on every platform. +# +# -ORBdemuxstrategy <which> +# where <which> can be one of 'dynamic', 'linear', 'active', or 'user', +# and specifies the type of object lookup strategy used internally. +# -ORBtablesize <unsigned> +# specifies the size of the object table +# +dynamic Resource_Factory Service_Object * TAO:_make_TAO_Resource_Factory() "-ORBresources global" +dynamic Client_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Client_Strategy_Factory() +dynamic Server_Strategy_Factory Service_Object * TAO:_make_TAO_Default_Server_Strategy_Factory() "-ORBconcurrency reactive -ORBdemuxstrategy dynamic -ORBtablesize 128" diff --git a/TAO/orbsvcs/tests/Makefile b/TAO/orbsvcs/tests/Makefile index f6471c39a08..daef1459fd9 100644 --- a/TAO/orbsvcs/tests/Makefile +++ b/TAO/orbsvcs/tests/Makefile @@ -10,6 +10,7 @@ DIRS = Simple_Naming \ Logger \ + Event_Latency \ #---------------------------------------------------------------------------- # Include macros and targets diff --git a/TAO/orbsvcs/tests/Simple_Naming/Makefile b/TAO/orbsvcs/tests/Simple_Naming/Makefile index b22d35a0b0b..d0ee2664619 100644 --- a/TAO/orbsvcs/tests/Simple_Naming/Makefile +++ b/TAO/orbsvcs/tests/Simple_Naming/Makefile @@ -36,8 +36,8 @@ TAO_ROOT = $(ACE_ROOT)/TAO endif TSS_ORB_FLAG = #-DTAO_HAS_TSS_ORBCORE DCFLAGS = -g -LDFLAGS += -L$(TAO_ROOT)/orbsvcs/lib -L$(TAO_ROOT)/tao -CPPFLAGS += -I$(TAO_ROOT)/orbsvcs/lib -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H +LDFLAGS += -L$(TAO_ROOT)/orbsvcs/orbsvcs -L$(TAO_ROOT)/tao +CPPFLAGS += -I$(TAO_ROOT)/orbsvcs -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(TSS_ORB_FLAG)#-H # DO NOT DELETE THIS LINE -- g++dep uses it. # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. @@ -203,8 +203,6 @@ CPPFLAGS += -I$(TAO_ROOT)/orbsvcs/lib -I$(TAO_ROOT) -I$(TAO_ROOT)/tao/compat $(T $(TAO_ROOT)/tao/default_client.i \ $(TAO_ROOT)/tao/default_server.i \ $(TAO_ROOT)/tao/connect.i \ - $(TAO_ROOT)/tao/singletons.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.h \ - $(TAO_ROOT)/orbsvcs/lib/CosNamingC.i + $(TAO_ROOT)/tao/singletons.h # IF YOU PUT ANYTHING HERE IT WILL GO AWAY diff --git a/TAO/orbsvcs/tests/Simple_Naming/clnt.h b/TAO/orbsvcs/tests/Simple_Naming/clnt.h index 001aaea1996..e24e326f482 100644 --- a/TAO/orbsvcs/tests/Simple_Naming/clnt.h +++ b/TAO/orbsvcs/tests/Simple_Naming/clnt.h @@ -21,7 +21,7 @@ #include "ace/Get_Opt.h" #include "tao/corba.h" -#include "CosNamingC.h" +#include "orbsvcs/CosNamingC.h" class CosNaming_Client // = TITLE diff --git a/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp b/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp index 8aababe5bad..78ef46f6c0d 100644 --- a/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp +++ b/TAO/tests/Cubit/TAO/IDL_Cubit/clnt.cpp @@ -566,9 +566,7 @@ Cubit_Client::run (void) this->cube_octet (i); this->cube_long (i); this->cube_struct (i); - //#if defined (TAO_ALSO_TEST_SEQUENCES) this->cube_sequence (i); - //#endif /* defined (TAO_ALSO_TEST_SEQUENCES) */ } // stop the timer. @@ -634,7 +632,6 @@ Cubit_Client::run (void) // compute call average call time. this->print_stats ("cube_union_dii call", elapsed_time); - //#if defined (TAO_ALSO_TEST_SEQUENCES) // Sequences timer.start (); this->call_count_ = 0; @@ -650,7 +647,6 @@ Cubit_Client::run (void) timer.elapsed_time (elapsed_time); // compute call average call time. this->print_stats ("cube_sequence", elapsed_time); - //#endif /* defined (TAO_ALSO_TEST_SEQUENCES) */ |