comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: RE: Protected Type Question.
Date: Tue, 12 Dec 2000 10:54:40 GMT
Date: 2000-12-12T10:54:40+00:00	[thread overview]
Message-ID: <91505f$4ll$1@nnrp1.deja.com> (raw)
In-Reply-To: B6A1A9B09E52D31183ED00A0C9E0888C469935@nctswashxchg.nctswash.navy.mil

In article
<B6A1A9B09E52D31183ED00A0C9E0888C469935@nctswashxchg.nctswash.na
vy.mil>,
  comp.lang.ada@ada.eu.org wrote:

> I'm well aware of the danger, and I totally
> agree that when at all possible the synchronization
> should be done at a higher level.  That's exactly
> the way it is done in other parts of our code.
> The only reason I'm trying the "semaphore" approach
> here is I was told on the ObjectAda list-server that
> Unchecked_Deallocation is potentially blocking,
> so it shouldn't be called from within a protected
> type.

This is a serious bug in ObjectAda if the allegation
is correct. An implementation is NOT permitted to
make arbitrary things PB, as per the statement in the
RM:

  18   Certain language-defined subprograms are potentially
  blocking.  ... When not specified as potentially blocking,
  a language-defined subprogram is nonblocking.

Unchecked_Deallocation is not specified as potentially blocking.

> If it is true, that it is potentially blocking,
> then I have to go with the "semaphore"
> approach, or use another task (which I was
> trying to avoid).

Well you are trying to work around a compiler bug here, so
that is definitely always awkward.

> Is Unchecked_Deallocation, or "new" for that
> matter, potentially blocking?

No.

> And before anyone asks why we are not using
> Unbounded_String, it is because we are trying to
> figure out why Unbounded_String started failing.
> Unbounded_Strings are released by setting them
> to Null_String.  There was no protected type
> involved (unless Unbounded_String is also a
> protected type).  The tasks were using the
> Unbounded_Strings, then setting them to Null_String.
> Somewhere along the line, after running for a
> long time, the Unbounded_Strings suddenly have
> residual data in them, as if the memory was
> picked up before the runtime cleared it.

Sounds like another bug unless I misunderstand your
description. And by the way, the original report is
of a bug in the run-time, since there is no reason
why the use of simple minded semaphores of this kind
should not work (we are discussing disadvantages of
this approach, but it is not the case that one of
the disadvantages is complete malfunction :-)

Sounds like you need to contact the vendor for
support here, things are not working the way they
should from your descriptions.

Robert Dewar


Sent via Deja.com http://www.deja.com/
Before you buy.



  reply	other threads:[~2000-12-12 10:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-12-12  5:49 Protected Type Question Beard, Frank
2000-12-12 10:54 ` Robert Dewar [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-01-03 20:58 protected type question shoko
2004-01-04  0:50 ` James Rogers
2004-01-04  1:04 ` Robert I. Eachus
2000-12-13 23:23 Protected Type Question Beard, Frank
2000-12-12  6:43 Beard, Frank
     [not found] <B6A1A9B09E52D31183ED00A0C9E0888C46992F@nctswashxchg.nctswash.navy.mil>
2000-12-12  3:39 ` tmoran
2000-12-12  1:45 Beard, Frank
2000-12-12  2:51 ` Robert Dewar
1996-03-20  0:00 Bill Pritchett
1996-03-20  0:00 ` Robert Dewar
replies disabled

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