From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,72daad0d97829ad6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Tue, 18 Jul 2006 16:11:53 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1153235397.700369.134780@35g2000cwc.googlegroups.com> Subject: Re: Tasking, protected objects, Ada 95 RM Date: Tue, 18 Jul 2006 16:12:37 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1807 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1807 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-VpjQyQVUMXVdkoaEEn1H6BOkKf4/knBx15IpFK/HxyMCse3Xi7x6hh13sRMSJH+98l2zKyHeHLoZVUy!Oj+l5Ck5VuPeK//y3ou+rkhoOaM1SLAm1Md/aAvAPZzfZa8bezBjOjNjBi6DNxVC5paQSReo7YQ8!fcKjRYF5hgg0vA== X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news2.google.com comp.lang.ada:5790 Date: 2006-07-18T16:12:37-05:00 List-Id: "ldb" wrote in message news:1153235397.700369.134780@35g2000cwc.googlegroups.com... ... > It goes on to define potentially blocking actions as, of course, an > entry_call. Now, I've never had my code raise a bounded error or a > program error. Here is a quick synopsis of my questions: > > 1) Am I misunderstanding this particular part of the manual, and it, in > fact, doesn't apply to my code? Mostly likely. You've misunderstood the meaning of "protected action". Loosely, that's the time when your program is executing *inside* of a protected object (executing the code of a protected object). Your description suggests you are not making an entry call from inside of a protected object. > 2) Should I be worried? No. > 3) Will -gnatp prevent this exception from being raised? A "bounded error" is not necessarily an exception. It's actually better in this case if it *is* an exception, because it indicates a fundamental design flaw in your program. There is (in Ada 2005) a pragma Detect_Blocking for this purpose. I think the vast majority of (portable) Ada programs should include this pragma (the check is not expensive, and the results if the error occurs are very dangerous and likely to be fatal). You really, really, really do not want this error to go undetected. If an exception is raised, you can find the cause and fix it (and even recover from it in a limited way). If the error is *not* detected, the most likely result is that your program will deadlock (the protected object will be locked and no other task can get into it). Another possible result is the loss of mutual exclusion for the protected object (which means it is highly likely that the code of the PO will fail because of assumption failure). Both of the latter are far harder to debug than getting an exception from the bad operation!! Do not fear detection of errors! Randy.