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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1b417df64012e6d3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-17 07:46:42 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.mathworks.com!wn3feed!worldnet.att.net!135.173.83.71!wnfilter1!worldnet-localpost!bgtnsc04-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3C94BA62.3050102@worldnet.att.net> From: Jim Rogers User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: tasks, protected types and entries References: <%12l8.9656$%_6.1717935@news11-gui.server.ntli.net> <562l8.9685$%_6.1720374@news11-gui.server.ntli.net> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Date: Sun, 17 Mar 2002 15:46:42 GMT NNTP-Posting-Host: 12.86.33.106 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc04-news.ops.worldnet.att.net 1016380002 12.86.33.106 (Sun, 17 Mar 2002 15:46:42 GMT) NNTP-Posting-Date: Sun, 17 Mar 2002 15:46:42 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:21367 Date: 2002-03-17T15:46:42+00:00 List-Id: To quote from "Ada as a Second Language" page 860: "A guard is a construct of the form when condition => that may precede some or all the alternatives of a selective accept. A guard has the same form as a barrier in a protected-type entry body (..) and plays a similar role." In short, yes, an entry barrier on a protected object does limit access to the protected object. A guard on a task's selective accept provides conditions for completion of a rendezvous. Jim Rogers chris.danx wrote: > "chris.danx" wrote in message > news:%12l8.9656$%_6.1717935@news11-gui.server.ntli.net... > >>Hi, >> >>What is the difference between an entry and a procedure? I think the >>difference is that 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. >> >>So for a (protected) queue, the procedure Enqueue (someitem) would run in >>any circumstance and the entry Dequeue (an_item: out sometype) would run >>only when it is sensible to do so. i.e. when there are items in the >> > Queue. > > That's ambiguous. I meant to say, > > "the procedure Enqueue (someitem) would run when called, but the entry > Dequeue (an_item : out sometype) would run when called, but only when it > made sense to do so. i.e. when there are items in the Queue." > > Another thought: Calls to entries can time out, right? Does that mean > after a certain time of the Queue being empty the calling task will abandon > the call to Dequeue, possibly doing something else? > > > Chris > > >