From: "W. Wesley Groleau (Wes)" <wwgrol@PSESERV3.FW.HAC.COM>
Subject: Alternative for AQS-95 para. 5.6.6
Date: 1996/04/04
Date: 1996-04-04T00:00:00+00:00 [thread overview]
Message-ID: <9604041602.AA04748@most> (raw)
Ada 95 Quality and Style carries forward the AQS-83 recommendation for
a safety check to prevent runaway looping or recursion. The suggestion
is based on a counter and a limit check. For real-time or safety critical
systems, a time limit may be more useful than a count. Is there any
detail I've missed that would prevent using the following technique?
select
delay Message_Interval * 0.75;
raise Processing_Took_Too_Long;
then abort
loop |or| Recursive_Subprogram;
end loop; | |
end select;
For Ada 83, please critique this:
Runaway.Start_Checking
( Check_ID => Local_Check, -- initializes ID which
<EITHER> Time_Limit => <duration> ); -- contains discriminant
<OR> Iter_Limit => <count> ); -- set by choice of start
[ while xxx | for xxx ] loop
Runaway.Check ( Local_Check );
-- raises Too_Much_Time or Too_Many_Times
Actual package Runaway is trivial to implement (and these are not my
original names). But I'm not sure it's worth the time. I had already
done the spec, but the file seems to have Run Away :-)
The above is not any easier than the AQS approach, but it does have the
advantage of standardizing the technique for a whole project.
I know I can count on c.l.a for plenty of useful feedback (and probably
a flame or two).
--
---------------------------------------------------------------------------
W. Wesley Groleau (Wes) Office: 219-429-4923
Magnavox - Mail Stop 10-40 Home: 219-471-7206
Fort Wayne, IN 46808 elm (Unix): wwgrol@pseserv3.fw.hac.com
---------------------------------------------------------------------------
reply other threads:[~1996-04-04 0:00 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox