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,19ad05fdbf4e671f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.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: Mon, 12 Dec 2005 15:59:31 -0600 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1134168554.826805.70690@g49g2000cwa.googlegroups.com> <1vb61utj75dws.gjbmfyig7vzz.dlg@40tude.net> <1134274006.711602.173280@g43g2000cwa.googlegroups.com> Subject: Re: Deallocating records with task type fields. Date: Mon, 12 Dec 2005 16:03:52 -0600 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-4axBm6iPOzyjVCJ567n7f5mlcnJYJMPqtY9BD50U9IaVyvkK6BFqFsqQRlJ5yK630/R3iT+Ja5aqk6m!bowplcrc+Q/wx4y9+QFFiIiHKnExLgIRNUrIe3bwfnSLNR+0+CMoKTP8357fGWLXLbfhxX2wpeA3 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:6854 Date: 2005-12-12T16:03:52-06:00 List-Id: "Gene" wrote in message news:1134274006.711602.173280@g43g2000cwa.googlegroups.com... ... > In fact the real environment record also has a protected output queue > with procedures to get data from the queue that the Listener has placed > there. That's the interesting case because other tasks need to call > functions that can touch the queue. I couldn't see a good way to > declare the queue on the task stack and yet allow other tasks to get > things from it. An idea for the future (Ada 200Y) - use a protected interface and an access to it. You'd still need to manage the pointer in some way (so it doesn't dangle - you'll have to use 'Unchecked_Access to create the pointer), but it would let you put the primary object inside of the task. Indeed, you probably can do this with an access-to-protected-type, too (presuming the objects are all the same type). Tasks that need to use the protected queue would call an entry to get the access-to-protected-object, then they could reference the queue normally via the access. If the callers don't copy the access, you don't even need any real management of the pointers (they call to the entry ensures that the queue exists). This is far from my favorite approach, but it at least has good storage management behavior. And it's probably better than twisting yourself in knots to get storage management of separate entities tied together. Randy.