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,8ee36bc9f5f21359 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.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: Fri, 20 May 2005 23:48:37 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1115772555.000422.205200@f14g2000cwb.googlegroups.com> <4288B9E2.2010109@adalog.fr> <1116619695.361267.218380@g49g2000cwa.googlegroups.com> Subject: Re: Need a Sanity Check Date: Fri, 20 May 2005 23:51:10 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4927.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4927.1200 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-ksK9j2BFMsMHijtMHjdgCTjuQq+DxJf1iy6tXCB/MSuKUGiLM9+RjxeUhoZG2i/t6ddqz7tKnpH0ck9!PQ+ZojZdly4Fdur9qCf8yYohbmULp6YJT+UIVDSemT9OHcvWLqXq1Kd4QtQlTYcXE/9Tj/lV+/+v 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: g2news1.google.com comp.lang.ada:11109 Date: 2005-05-20T23:51:10-05:00 List-Id: "mark" wrote in message news:1116619695.361267.218380@g49g2000cwa.googlegroups.com... > "(but an accept statement cannot be called from within a protected > subprogram or entry)." > > Is that a language restriction? Compiling using GNAT I get - > > warning: potentially blocking operation in protected operation > > when calling another tasks entry point from within a protected entry. > I'm sure its not going to block based on the task it is calling has a > single accept and is only called from this protected entry. The task > called does nothing special besides dump a buffer to disk. Doing it > this way just decouples the disk write from the rest of the system. > > So, is GNAT not enforcing language standards or is that really not part > of the standard? It's a bounded error, meaning that it either raises Program_Error or goes forward (which might cause deadlock). In any case, it is not checked at compile-time (because you could call anything from a protected object). And even if it works on a specific compiler, it's not portable; another compiler might raise Program_Error. Note that Ada 2006 adds a pragma Detect_Blocking, which changes this to a requirement to raise Program_Error. (That's part of Ravenscar, but I generally recommend it to everyone, because it makes the behavior predictable.) Randy.