comp.lang.ada
 help / color / mirror / Atom feed
From: Niklas Holsti <nholsti@icon.fi>
Cc: Niklas Holsti <Niklas.Holsti@ssf.fi>
Subject: Re: How can I avoid Using a Semaphore? (long)
Date: Fri, 02 Feb 2001 23:38:37 +0200
Date: 2001-02-02T21:35:52+00:00	[thread overview]
Message-ID: <3A7B28DD.950D8114@icon.fi> (raw)
In-Reply-To: cd%76.260429$U46.8278617@news1.sttls1.wa.home.com

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



  parent reply	other threads:[~2001-02-02 21:38 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-13 16:18 How can I avoid Using a Semaphore? (long) DuckE
2001-01-15  1:06 ` How can I avoid Using a Semaphore? Nick Roberts
2001-01-15  3:17   ` Robert Dewar
2001-01-16  3:53   ` DuckE
2001-01-17 15:42     ` Nick Roberts
2001-01-20 18:16       ` DuckE
2001-01-20 19:16         ` Robert Dewar
2001-01-21  1:28           ` DuckE
2001-01-21 16:04             ` Robert Dewar
2001-01-21 23:23               ` DuckE
2001-01-22  0:28                 ` mark_lundquist
2001-01-22  1:51                 ` Robert Dewar
2001-01-23  2:36                   ` DuckE
2001-01-22  0:35               ` Built-in types (was " mark_lundquist
2001-01-22  1:54                 ` Robert Dewar
2001-01-22 16:18                   ` mark_lundquist
2001-01-22 17:20                     ` Robert Dewar
2001-01-22 23:17                       ` Mark Lundquist
     [not found]                         ` <m33deaaeks.fsf@ns40.infomatch.bc.ca>
2001-02-02 22:01                           ` Mark Lundquist
     [not found]                         ` <94km00$bv8$1@nnrp1.deja.com>
2001-02-02 22:03                           ` Mark Lundquist
2001-01-21 16:53           ` Nick Roberts
2001-01-21 18:24             ` Robert Dewar
2001-01-23  0:21               ` Nick Roberts
2001-01-22  0:16         ` mark_lundquist
2001-01-22 16:51 ` How can I avoid Using a Semaphore? (long) mark_lundquist
2001-01-23  6:02   ` DuckE
2001-02-02 22:00     ` Sucking (was Re: How can I avoid Using a Semaphore? (long)) Mark Lundquist
2001-02-03  1:44       ` Jeffrey Carter
2001-02-03  3:21       ` DuckE
2001-02-05 20:07         ` Mark Lundquist
2001-02-06  7:16           ` Sven Nilsson
2001-02-02 22:18     ` How can I avoid Using a Semaphore? (long) Mark Lundquist
2001-02-03  3:01       ` DuckE
2001-02-02 21:38 ` Niklas Holsti [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-02-07 21:55 Beard, Frank
2001-02-08 23:42 Beard, Frank
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox