TEAM-ADA Archives

Team Ada: Ada Programming Language Advocacy


Options: Use Forum View

Use Proportional Font
Show HTML Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
John Ross <[log in to unmask]>
Reply To:
Wed, 5 Mar 1997 19:57:21 -0000
text/plain (74 lines)

After lurking on the team for several months I now have a query, I am
currently working on a real time system - and have been for several months
and one of my areas of responsibility has been system performance. We have
been measuring performance of various tasks using a logic analyser and a
simple instrumentation which "logs on" and "off" via a simple system of
writing to a specific address in memory and then monitoring writes with the
logic analyser. Whilst this was fine for initial investigation, it is quite
long winded and technical for pure software engineers to gather performance
data. and we plan to implement a solution which records performance data
continuously. Each task (in the curent system) runs on a predefined cycle
time - that is it performs its functions and then delays to make the cycle
time up (delay current_time - (start_time - cycle_time)). I am aware that
this is not a very clever way of doing things but the redesign required to
remove the inherent problems with this design will come later.

My best solution for this at the moment works in prototype and is
implemented as a task which accepts a sign on and a sign off from a list of
tasks and maintains which task is running. So a task signs on after it's
delay and signs off after it  has finished processing. When another task
signs on before the one being currently monitored signs off timing for the
current task is suspended (ie the time at which this happened is recorded)
and monitoring of the new task is started. When a task signs off the task
that had its time suspended before the other task signed on has its timing
resumed with an appropriate adjustment to account for the time taken by the
other task. The basic Ada structure for this is a follows

task body Time_Monitoring_Task_Type is
  Local_Task : Task_Type;
      accept Start_Monitoring;
               accept Reset_Data;
               accept Report_Data;
               -- report data with appropriate method
               accept Sign_On(The_Task : in Task_Type) do
                    Local_Task := The_Task;
               end Sign_On;
               -- Sign on the task and pause monitoring of current task if
               accept Sign_Off(The_Task : in Task_Type) do
                   Local_Task := The_Task;
               end Sign_Off;
               -- Sign off the task and resume monitoring of last task
               accept Stop_Monitoring;
         end select;
    end loop;

Apart from syntax, errors which are bound to be in the above has anyone any
comments on the suitability of this algorithm given that the sign_on and
sign_off are significantly complex and will consume a significant amount of

If you require any further information details of the sign_on and sign_off
routines can be supplied. I would be very grateful for any of your advice.

John Ross
Galagrip Ltd. (Director)
Any opinions expressed or otherwise are also my actual opinions.