diff options
author | venkita <venkita@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-14 20:21:31 +0000 |
---|---|---|
committer | venkita <venkita@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-04-14 20:21:31 +0000 |
commit | 9059df93e1e7c1da8c8a0bd3d8d00d876678bc96 (patch) | |
tree | 06eef99272a28a4d0ce3cb405df51c001a654e29 /Kokyu/tests | |
parent | 1aba0c364bf329b0bf8851656c969fb636cc3d3a (diff) | |
download | ATCD-9059df93e1e7c1da8c8a0bd3d8d00d876678bc96.tar.gz |
ChangeLogTag: Mon Apr 14 15:19:38 2003 Venkita Subramonian <venkita@cs.wustl.edu>
Diffstat (limited to 'Kokyu/tests')
-rw-r--r-- | Kokyu/tests/DSRT_MIF/MIF.cpp | 88 | ||||
-rw-r--r-- | Kokyu/tests/DSRT_MIF/Makefile | 179 |
2 files changed, 267 insertions, 0 deletions
diff --git a/Kokyu/tests/DSRT_MIF/MIF.cpp b/Kokyu/tests/DSRT_MIF/MIF.cpp new file mode 100644 index 00000000000..67bd2e00605 --- /dev/null +++ b/Kokyu/tests/DSRT_MIF/MIF.cpp @@ -0,0 +1,88 @@ +// $Id$ + +#include "ace/Auto_Ptr.h" + +#include "Kokyu.h" +#include "ace/Task.h" +#include "ace/Sched_Params.h" + +class MyTask : public ACE_Task_Base +{ +public: + + MyTask (ACE_Barrier& barrier, + Kokyu::DSRT_Dispatcher* dispatcher, + Kokyu::QoSDescriptor& qos) + :barrier_ (barrier), + dispatcher_ (dispatcher), + qos_ (qos) + {} + + int svc (void) + { + dispatcher_->schedule (0, qos_); + barrier_.wait (); + + ACE_hthread_t thr_handle; + ACE_Thread::self (thr_handle); + int prio; + + if (ACE_Thread::getprio (thr_handle, prio) == -1) + { + if (errno == ENOTSUP) + { + ACE_DEBUG((LM_DEBUG, + ACE_TEXT ("getprior not supported on this platform\n") + )); + return 0; + } + ACE_ERROR_RETURN ((LM_ERROR, + ACE_TEXT ("%p\n"), + ACE_TEXT ("getprio failed")), + -1); + } + + ACE_DEBUG ((LM_DEBUG, "(%t) Thread prio is %d\n", prio)); + return 0; + } + +private: + ACE_Barrier& barrier_; + Kokyu::DSRT_Dispatcher* dispatcher_; + Kokyu::QoSDescriptor& qos_; +}; + +int main (int,char**) +{ + Kokyu::DSRT_ConfigInfo config_info; + + config_info.scheduler_type_ = Kokyu::SCHED_MIF; + + ACE_Barrier barrier (3); + + ACE_DEBUG ((LM_DEBUG, "before create_dispatcher\n" )); + auto_ptr<Kokyu::DSRT_Dispatcher> + disp (Kokyu::Dispatcher_Factory::create_DSRT_dispatcher (config_info)); + + ACE_ASSERT (disp.get () != 0); + + Kokyu::QoSDescriptor qos1, qos2, qos3; + + qos1.importance_ = Kokyu::LOW_IMPORTANCE; + qos2.importance_ = Kokyu::HIGH_IMPORTANCE; + qos3.importance_ = Kokyu::VERY_HIGH_IMPORTANCE; + + MyTask mytask1 (barrier, disp.get (), qos1); + MyTask mytask2 (barrier, disp.get (), qos2); + MyTask mytask3 (barrier, disp.get (), qos3); + + long flags = THR_BOUND | THR_SCHED_FIFO; + + mytask1.activate(flags); + mytask2.activate(flags); + mytask3.activate(flags); + + while(1){} + + return 0; +} diff --git a/Kokyu/tests/DSRT_MIF/Makefile b/Kokyu/tests/DSRT_MIF/Makefile new file mode 100644 index 00000000000..452112fcda4 --- /dev/null +++ b/Kokyu/tests/DSRT_MIF/Makefile @@ -0,0 +1,179 @@ +#---------------------------------------------------------------------------- +# $Id$ +# +#---------------------------------------------------------------------------- +# Local macros +#---------------------------------------------------------------------------- + +BIN = MIF + +LSRC = $(addsuffix .cpp,$(BIN)) + +VLDLIBS = $(LDLIBS:%=%$(VAR)) + +BUILD = $(VBIN) + +#---------------------------------------------------------------------------- +# 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 + +#---------------------------------------------------------------------------- +# Local targets +#---------------------------------------------------------------------------- + +CPPFLAGS += -I$(ACE_ROOT)/Kokyu +LDFLAGS += -lKokyu + +#---------------------------------------------------------------------------- +# Dependencies +#---------------------------------------------------------------------------- + +# DO NOT DELETE THIS LINE -- g++dep uses it. +# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. + + +.obj/MIF.o .obj/MIF.so .shobj/MIF.o .shobj/MIF.so: MIF.cpp $(ACE_ROOT)/ace/Auto_Ptr.h \ + $(ACE_ROOT)/ace/pre.h \ + $(ACE_ROOT)/ace/post.h \ + $(ACE_ROOT)/ace/ace_wchar.h \ + $(ACE_ROOT)/ace/ace_wchar.inl \ + $(ACE_ROOT)/ace/Trace.h \ + $(ACE_ROOT)/ace/ACE_export.h \ + $(ACE_ROOT)/ace/Global_Macros.h \ + $(ACE_ROOT)/ace/OS_Export.h \ + $(ACE_ROOT)/ace/Auto_Ptr.i \ + $(ACE_ROOT)/ace/Auto_Ptr.cpp \ + $(ACE_ROOT)/Kokyu/Kokyu.h \ + $(ACE_ROOT)/ace/OS.h \ + $(ACE_ROOT)/ace/OS_Dirent.h \ + $(ACE_ROOT)/ace/OS_Errno.h \ + $(ACE_ROOT)/ace/OS_Errno.inl \ + $(ACE_ROOT)/ace/OS_Dirent.inl \ + $(ACE_ROOT)/ace/OS_String.h \ + $(ACE_ROOT)/ace/Basic_Types.h \ + $(ACE_ROOT)/ace/Basic_Types.i \ + $(ACE_ROOT)/ace/OS_String.inl \ + $(ACE_ROOT)/ace/OS_Memory.h \ + $(ACE_ROOT)/ace/OS_Memory.inl \ + $(ACE_ROOT)/ace/OS_TLI.h \ + $(ACE_ROOT)/ace/OS_TLI.inl \ + $(ACE_ROOT)/ace/Time_Value.h \ + $(ACE_ROOT)/ace/Time_Value.inl \ + $(ACE_ROOT)/ace/Default_Constants.h \ + $(ACE_ROOT)/ace/Min_Max.h \ + $(ACE_ROOT)/ace/streams.h \ + $(ACE_ROOT)/ace/OS.i \ + $(ACE_ROOT)/ace/Array.h \ + $(ACE_ROOT)/ace/Containers_T.h \ + $(ACE_ROOT)/ace/Containers.h \ + $(ACE_ROOT)/ace/Containers.i \ + $(ACE_ROOT)/ace/Node.h \ + $(ACE_ROOT)/ace/Node.cpp \ + $(ACE_ROOT)/ace/Array_Base.h \ + $(ACE_ROOT)/ace/Malloc_Base.h \ + $(ACE_ROOT)/ace/Array_Base.inl \ + $(ACE_ROOT)/ace/Array_Base.cpp \ + $(ACE_ROOT)/ace/Unbounded_Set.h \ + $(ACE_ROOT)/ace/Unbounded_Set.inl \ + $(ACE_ROOT)/ace/Unbounded_Set.cpp \ + $(ACE_ROOT)/ace/Log_Msg.h \ + $(ACE_ROOT)/ace/Log_Priority.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.h \ + $(ACE_ROOT)/ace/OS_Log_Msg_Attributes.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.h \ + $(ACE_ROOT)/ace/Unbounded_Queue.inl \ + $(ACE_ROOT)/ace/Unbounded_Queue.cpp \ + $(ACE_ROOT)/ace/Containers_T.i \ + $(ACE_ROOT)/ace/Containers_T.cpp \ + $(ACE_ROOT)/ace/Message_Block.h \ + $(ACE_ROOT)/ace/Message_Block.i \ + $(ACE_ROOT)/ace/Message_Block_T.h \ + $(ACE_ROOT)/ace/Message_Block_T.i \ + $(ACE_ROOT)/ace/Message_Block_T.cpp \ + $(ACE_ROOT)/Kokyu/kokyu_export.h \ + $(ACE_ROOT)/Kokyu/Kokyu.i \ + $(ACE_ROOT)/Kokyu/Dispatcher_Impl.h \ + $(ACE_ROOT)/Kokyu/Dispatcher_Impl.i \ + $(ACE_ROOT)/Kokyu/DSRT_Dispatcher_Impl.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/Svc_Conf_Tokens.h \ + $(ACE_ROOT)/ace/Event_Handler.h \ + $(ACE_ROOT)/ace/Event_Handler.i \ + $(ACE_ROOT)/ace/DLL.h \ + $(ACE_ROOT)/ace/Service_Object.i \ + $(ACE_ROOT)/ace/Thread_Manager.h \ + $(ACE_ROOT)/ace/Thread.h \ + $(ACE_ROOT)/ace/Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.h \ + $(ACE_ROOT)/ace/Base_Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread_Adapter.inl \ + $(ACE_ROOT)/ace/Thread.i \ + $(ACE_ROOT)/ace/Thread_Exit.h \ + $(ACE_ROOT)/ace/Thread_Control.h \ + $(ACE_ROOT)/ace/Thread_Control.inl \ + $(ACE_ROOT)/ace/Synch.h \ + $(ACE_ROOT)/ace/Synch.i \ + $(ACE_ROOT)/ace/Synch_T.h \ + $(ACE_ROOT)/ace/Synch_T.i \ + $(ACE_ROOT)/ace/Synch_T.cpp \ + $(ACE_ROOT)/ace/Free_List.h \ + $(ACE_ROOT)/ace/Free_List.i \ + $(ACE_ROOT)/ace/Free_List.cpp \ + $(ACE_ROOT)/ace/Singleton.h \ + $(ACE_ROOT)/ace/Singleton.i \ + $(ACE_ROOT)/ace/Singleton.cpp \ + $(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/Managed_Object.cpp \ + $(ACE_ROOT)/ace/Framework_Component.h \ + $(ACE_ROOT)/ace/Framework_Component.inl \ + $(ACE_ROOT)/ace/ACE.h \ + $(ACE_ROOT)/ace/Flag_Manip.h \ + $(ACE_ROOT)/ace/Flag_Manip.i \ + $(ACE_ROOT)/ace/Handle_Ops.h \ + $(ACE_ROOT)/ace/Handle_Ops.i \ + $(ACE_ROOT)/ace/Lib_Find.h \ + $(ACE_ROOT)/ace/Lib_Find.i \ + $(ACE_ROOT)/ace/Init_ACE.h \ + $(ACE_ROOT)/ace/Init_ACE.i \ + $(ACE_ROOT)/ace/Sock_Connect.h \ + $(ACE_ROOT)/ace/Sock_Connect.i \ + $(ACE_ROOT)/ace/ACE.i \ + $(ACE_ROOT)/ace/Framework_Component_T.h \ + $(ACE_ROOT)/ace/Framework_Component_T.inl \ + $(ACE_ROOT)/ace/Framework_Component_T.cpp \ + $(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_T.h \ + $(ACE_ROOT)/ace/Message_Queue_T.i \ + $(ACE_ROOT)/ace/Message_Queue_T.cpp \ + $(ACE_ROOT)/ace/Notification_Strategy.h \ + $(ACE_ROOT)/ace/Notification_Strategy.inl \ + $(ACE_ROOT)/ace/Message_Queue.i \ + $(ACE_ROOT)/ace/Task_T.i \ + $(ACE_ROOT)/ace/Task_T.cpp \ + $(ACE_ROOT)/ace/Module.h \ + $(ACE_ROOT)/ace/Module.i \ + $(ACE_ROOT)/ace/Module.cpp \ + $(ACE_ROOT)/ace/Stream_Modules.h \ + $(ACE_ROOT)/ace/Stream_Modules.cpp \ + $(ACE_ROOT)/Kokyu/DSRT_Dispatcher_Impl.i \ + $(ACE_ROOT)/ace/Sched_Params.h \ + $(ACE_ROOT)/ace/Sched_Params.i + +# IF YOU PUT ANYTHING HERE IT WILL GO AWAY |