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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1b417df64012e6d3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-17 11:37:06 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!feed2.news.rcn.net!rcn!newsfeed1.earthlink.net!newsfeed2.earthlink.net!newsfeed.earthlink.net!newsfeed0.news.atl.earthlink.net!news.atl.earthlink.net!news.mindspring.net!not-for-mail From: Richard Riehle Newsgroups: comp.lang.ada Subject: Re: tasks, protected types and entries Date: Sun, 17 Mar 2002 11:44:54 -0800 Organization: AdaWorks Software Engineering Message-ID: <3C94F235.80C7166A@adaworks.com> References: <%12l8.9656$%_6.1717935@news11-gui.server.ntli.net> Reply-To: richard@adaworks.com NNTP-Posting-Host: 9e.fc.cc.93 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Server-Date: 17 Mar 2002 19:36:55 GMT X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en Xref: archiver1.google.com comp.lang.ada:21374 Date: 2002-03-17T19:36:55+00:00 List-Id: "chris.danx" wrote: > What is the difference between an entry and a procedure? This is one of the most important and least often address issue in Ada. In my classroom, after we have started our unit on tasking, I have my students recite, in unison, "An entry has a queue." That is so fundamental, and so overlooked. I believe it is a starting point for understanding all the associated mechanisms. The properties of the queue itself, and behavior of its enclosing task or protected object can be understood only when one grasps this simple idea. Yet I encounter programmers who have been using Ada for years who still don't know this. > ... a procedure will always execute regardless of any > condition, but that an entry can have a guard to allow/prevent its execution > if a given condition is satisfied. There are no guards on subprograms (procedures and functions). If there were, they would be called pre-conditions. In fact, protected entry barriers, and task entry guards, are simply a variation-on-the-theme of pre-conditions. Richard Riehle