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,9bbec8931498da16 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-24 19:20:26 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!wn3feed!wn2feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: tmoran@acm.org Newsgroups: comp.lang.ada Subject: Re: Help! (Ada/Integrity/PEG) References: <20011224164545.047b68e6.nospam@attbi.com> X-Newsreader: Tom's custom newsreader Message-ID: NNTP-Posting-Host: 12.234.125.134 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1009250425 12.234.125.134 (Tue, 25 Dec 2001 03:20:25 GMT) NNTP-Posting-Date: Tue, 25 Dec 2001 03:20:25 GMT Organization: AT&T Broadband Date: Tue, 25 Dec 2001 03:20:25 GMT Xref: archiver1.google.com comp.lang.ada:18289 Date: 2001-12-25T03:20:25+00:00 List-Id: > 2. As either task can insert information into the qeue, I use a semaphore > to control when either task can access. A semaphore is a concept from the > Unix world ... If I understand what you're doing, an Ada "protected record" would be just the ticket here. The queue data is hidden inside and the routines to insert/remove items are visible, but only one routine is allowed to execute at a time, so two tasks can't step on each other's feet. Essentially you let the compiler handle the semaphore for you, making your life simpler and less subject to mistakes, and the compiler run-time probably does the job more efficiently.