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,6f69b1cf0f02b9ac X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-02-02 13:36:09 PST Path: supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!194.255.56.67!newsfeed101.telia.com!newsrouter.euroconnect.net!news.clinet.fi!news.cc.tut.fi!uutiset.saunalahti.fi!not-for-mail From: Niklas Holsti Newsgroups: comp.lang.ada Subject: Re: How can I avoid Using a Semaphore? (long) Date: Fri, 02 Feb 2001 23:38:37 +0200 Organization: Space Systems Finland Ltd Message-ID: <3A7B28DD.950D8114@icon.fi> References: NNTP-Posting-Host: mccx.hdyn.saunalahti.fi Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: tron.sci.fi 981149752 6851 195.197.40.10 (2 Feb 2001 21:35:52 GMT) X-Complaints-To: newsmaster@saunalahti.fi NNTP-Posting-Date: 2 Feb 2001 21:35:52 GMT Cc: Niklas Holsti X-Mailer: Mozilla 4.04 [en] (X11; I; Linux 2.0.0 i486) Xref: supernews.google.com comp.lang.ada:4874 Date: 2001-02-02T21:35:52+00:00 List-Id: DuckE wrote: > > I have an application that receives a streams of data from TCP/IP sockets. [ snip ] > > To avoid memory leaks I am using a controlled type with reference counting > to implement my data buffer. Since multiple threads may simultaneously have > access to the buffer, I use a protected type for reference counting. > > Since I am using a protected type for reference counting, I cannot assign > packets within a protected type (to implement queue's of packets for > instance) since these assignments would be attempting to do a protected > operation within a protected type. As I understand the LRM, you are allowed to use *other* protected objects from within a protected type. By LRM 9.5.1(15), a call on a protected subprogram is only considered potentially blocking if it is an "external" call and has the same target object as the action that performs the call. In your case, the caller (queue) and callee (reference counter) would be actions of different protected types, so the call would not be potentially blocking. Niklas Holsti Working at but not speaking for Space Systems Finland