1 // Driver program that measures the performance of synchronization
2 // mechanisms provided by ACE and the underlying OS.
4 #include "ace/Log_Msg.h"
5 #include "ace/Service_Config.h"
6 #include "ace/Service_Repository.h"
7 #include "Synch_Lib/Benchmark_Base.h"
9 #if defined (ACE_HAS_THREADS)
11 ACE_TMAIN (int argc
, ACE_TCHAR
*argv
[])
13 ACE_Service_Config::open (argc
, argv
);
14 ACE_Service_Repository_Iterator
sri (*ACE_Service_Repository::instance ());
16 // Iteratively execute each service loaded in from the svc.conf
19 for (const ACE_Service_Type
*sr
;
22 // This would greatly benefit from RTTI typesafe downcasting...
23 const ACE_Service_Type_Impl
*type
= sr
->type ();
24 const void *obj
= type
->object ();
25 ACE_Service_Object
*so
= (ACE_Service_Object
*) obj
;
26 Benchmark_Base
*bb
= (Benchmark_Base
*) so
;
28 if (bb
->benchmark_type () == Benchmark_Base::METHOD
)
30 Benchmark_Method_Base
*bm
= (Benchmark_Method_Base
*) bb
;
32 ACE_DEBUG ((LM_DEBUG
, "\n\nExecuting %s\n", sr
->name ()));
43 ACE_TMAIN (int, ACE_TCHAR
*[])
45 ACE_ERROR_RETURN ((LM_ERROR
,
46 "This test requires the platform to have threads\n"), -1);
48 #endif /* ACE_HAS_THREADS */