comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Ada Protected Object Tutorial #1
Date: 1999/12/17
Date: 1999-12-17T00:00:00+00:00	[thread overview]
Message-ID: <wcc1z8m8k9o.fsf@world.std.com> (raw)
In-Reply-To: slrn85h77n.68i.kaz@ashi.FootPrints.net

kaz@ashi.footprints.net (Kaz Kylheku) writes:

> What if a protected procedure of an object calls another
> protected procedure? Presumably this is allowed, which means that some
> recursive lock has to be used for the implementation, or else the compiler has
> to generate code that passes around secret ``already locked'' flags into
> procedures. 

No, there's no such fancy run-time stuff in Ada 95's protected objects.
The rules ensure that it is known at compile time whether a lock should
be grabbed.  (And there is, of course, some potential for deadlock.)

> What if you want to block for something in the middle of the critical region?
> I assume that you can call a protected entry from within a protected procedure.

No, you can't.  If you want to block in the middle, then you have to
call the thing an "entry" and not a "procedure".  One common thing to do
is to have an entry with a True barrier, so it always goes right ahead,
but then it can block by requeuing to a different entry (of the same
protected object, or a different one); it will then block on a new
barrier.  Protected procedures, on the other had, can't block.

- Bob




  parent reply	other threads:[~1999-12-17  0:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-12-15  0:00 Ada Protected Object Tutorial #1 James S. Rogers
1999-12-16  0:00 ` Kaz Kylheku
1999-12-16  0:00   ` James S. Rogers
1999-12-17  0:00     ` Laurent Guerby
1999-12-16  0:00   ` John English
1999-12-16  0:00     ` Ed Falis
1999-12-16  0:00       ` Usenet Poster Boy
1999-12-17  0:00     ` Karel Th�nissen
1999-12-17  0:00       ` Laurent Guerby
1999-12-18  0:00         ` Karel Th�nissen
1999-12-18  0:00           ` Laurent Guerby
1999-12-18  0:00         ` Kaz Kylheku
1999-12-18  0:00           ` Robert A Duff
1999-12-18  0:00             ` Kaz Kylheku
1999-12-18  0:00           ` Laurent Guerby
1999-12-18  0:00             ` Kaz Kylheku
1999-12-19  0:00               ` Laurent Guerby
1999-12-20  0:00                 ` Stanley R. Allen
1999-12-21  0:00               ` Robert I. Eachus
     [not found]             ` <33qr5scnbs04v391ev4541p5bv48hklg3q@4ax.com>
1999-12-20  0:00               ` Robert A Duff
1999-12-17  0:00       ` Mike Silva
1999-12-24  0:00       ` Kenneth Almquist
1999-12-17  0:00   ` Tucker Taft
1999-12-18  0:00     ` Kaz Kylheku
1999-12-18  0:00       ` Robert A Duff
1999-12-18  0:00         ` Kaz Kylheku
1999-12-19  0:00           ` swhalen
1999-12-19  0:00             ` Kaz Kylheku
1999-12-19  0:00               ` Robert Dewar
1999-12-19  0:00               ` Laurent Guerby
1999-12-20  0:00       ` Vladimir Olensky
1999-12-26  0:00         ` Ehud Lamm
1999-12-26  0:00           ` Robert Dewar
1999-12-26  0:00             ` Kaz Kylheku
1999-12-27  0:00               ` Robert Dewar
1999-12-27  0:00                 ` Richard D Riehle
1999-12-27  0:00                   ` Robert Dewar
1999-12-31  0:00                     ` Richard D Riehle
1999-12-27  0:00                 ` Jean-Pierre Rosen
1999-12-27  0:00               ` Robert Dewar
2000-01-02  0:00             ` Tucker Taft
1999-12-17  0:00   ` Robert A Duff [this message]
1999-12-17  0:00     ` Vladimir Olensky
1999-12-17  0:00 ` Robert A Duff
1999-12-18  0:00   ` Kaz Kylheku
replies disabled

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