home *** CD-ROM | disk | FTP | other *** search
-
- -- PERFORMANCE MEASUREMENT : Minimum entry call and return time
- -- 1 task 1 entry
- -- no select
- --
- -- This ia a version on T000001 without the " do .. end ; "
- -- This will not work in most implementations because the checking
- -- to be sure the task executions have completed fails.
- -- If this test does run, please report it if the times differ
- -- from T000001.
-
- with REMOTE_GLOBAL ; use REMOTE_GLOBAL ; -- control optimization
- with ITERATION ; -- obtain stable measurement
- with PIWG_IO ; -- output results
-
- procedure T000007 is -- main procedure to execute
-
- CPU_TIME : DURATION ; -- CPU time for one feature execution
- WALL_TIME : DURATION ; -- WALL time for one feature execution
- CHECK_TIMES : constant := 100 ; -- inside loop count and check
- ITERATION_COUNT : INTEGER ; -- set and varied by ITERATION package
- STABLE : BOOLEAN ; -- true when measurement stable
-
- --
- task T1 is
- entry E1 ;
- end T1 ;
-
- task body T1 is
- begin
- loop
- accept E1 ;
- GLOBAL := GLOBAL + A_ONE ;
- REMOTE ;
- end loop ;
- end ;
-
- begin
-
- ITERATION.START_CONTROL ; -- dummy to bring in pages on some machines
-
- delay 0.5 ; -- wait for stable enviornment on some machines
-
- ITERATION.INITIALIZE ( ITERATION_COUNT ) ;
-
- loop -- until stable measurement, ITERATION_COUNT increases each time
-
- --
- -- Control loop
- --
- ITERATION.START_CONTROL ;
- for J in 1 .. ITERATION_COUNT loop
- GLOBAL := 0 ;
- for INSIDE_LOOP in 1 .. CHECK_TIMES loop
- GLOBAL := GLOBAL + A_ONE ;
- REMOTE ;
- end loop ;
- end loop ;
- ITERATION.STOP_CONTROL ( GLOBAL , CHECK_TIMES ) ;
-
- --
- -- Test loop
- --
- ITERATION.START_TEST ;
- for J in 1 .. ITERATION_COUNT loop
- GLOBAL := 0 ;
- for INSIDE_LOOP in 1 .. CHECK_TIMES loop
- T1.E1 ; -- this has control global increment and call inside
- end loop ;
- end loop ;
- ITERATION.STOP_TEST ( GLOBAL , CHECK_TIMES ) ;
- ITERATION.TEST_STABLE ( ITERATION_COUNT , STABLE ) ;
- exit when STABLE ;
- end loop ;
- --
- ITERATION.FEATURE_TIMES ( CPU_TIME , WALL_TIME ) ;
-
- --
- -- Printout
- --
- PIWG_IO.PIWG_OUTPUT ( "T000007" , "Tasking" ,
- CPU_TIME , WALL_TIME , ITERATION_COUNT ,
- " Minimum rendezvous, entry call and return time " ,
- " 1 task 1 entry " ,
- " no select " ) ;
-
- abort T1 ;
-
- end T000007 ;
-