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.9 required=5.0 tests=BAYES_00,HK_NAME_MR_MRS autolearn=no 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-25 02:35:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!wn4feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc53.POSTED!not-for-mail From: Mr. Caffiene Newsgroups: comp.lang.ada Subject: Re: Help! (Ada/Integrity/PEG) Message-ID: <20011225053959.69d97022.nospam@attbi.com> References: <20011224164545.047b68e6.nospam@attbi.com> Organization: Caffienated Corps. X-Newsreader: Sylpheed version 0.6.5 (GTK+ 1.2.10; i586-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 12.245.48.122 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc53 1009276555 12.245.48.122 (Tue, 25 Dec 2001 10:35:55 GMT) NNTP-Posting-Date: Tue, 25 Dec 2001 10:35:55 GMT Date: Tue, 25 Dec 2001 10:35:55 GMT Xref: archiver1.google.com comp.lang.ada:18291 Date: 2001-12-25T10:35:55+00:00 List-Id: On Tue, 25 Dec 2001 03:20:25 GMT tmoran@acm.org wrote: > > 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. Hmmmm...I dont doubt that it's simpler. I'll test that method out. I'm curious how much of a performance penalty the compiler runtime would cause. I'm used to explicitly declaring and controlling the memory from scratch(likely due to my C and Assembler roots) however an implicit run-time just might prove to be more effective in this particular task. I'll let you know what I discover. Mr. Caffiene Merry X-mas chris@dont.spam.me