comp.lang.ada
 help / color / mirror / Atom feed
From: Laurent Guerby <guerby@acm.org>
Subject: Re: Ada Protected Object Tutorial #1
Date: 1999/12/19
Date: 1999-12-18T23:10:36+00:00	[thread overview]
Message-ID: <86zov7j0xy.fsf@ppp-116-44.villette.club-internet.fr> (raw)
In-Reply-To: slrn85nvtm.4ps.kaz@ashi.FootPrints.net

kaz@ashi.footprints.net (Kaz Kylheku) writes:
> That's good. I follow the same principles generally, but without
> language help it's easy to make mistakes like do some blocking
> thing inside a tight critical section or create deadlock.

Agreed.

> What do you do if you need a protected procedure to call out into
> some other module which then calls back? 

You wouldn't do this inside the protected procedure code.

> Using explicit locks, I just unlock, do the call, lock again
> thereby avoiding deadlock.

That's how you would do it in Ada too (with an explicit mutex and
caller care). The protected objects aren't designed to solve this kind
of problem, they solve cleany most of the cases, if you have a complex
nested locks scheme, you have to do it by hand (note that the GNAT
runtime just does this, it has a very fine grained locking model by
default to allow concurrency inside itself).

> Though I don't use Ada, I have a hard copy of the standard somewhere under my
> desk, so I can take a look.

Or online: <http://www.adahome.com/rm95/>

You can get the annotated version (giving the insight on
the language design) in ASCII at 

<http://www.adaic.org/standards/95lrm/LRMascii/aarm.txt>

(There is also a PostScript version, beware it's 800 pages ;-).

--LG




  reply	other threads:[~1999-12-19  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       ` Mike Silva
1999-12-17  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 [this message]
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-18  0:00         ` Karel Th�nissen
1999-12-18  0:00           ` Laurent Guerby
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               ` Laurent Guerby
1999-12-19  0:00               ` Robert Dewar
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               ` Robert Dewar
1999-12-27  0:00                 ` Jean-Pierre Rosen
1999-12-27  0:00                 ` Richard D Riehle
1999-12-27  0:00                   ` Robert Dewar
1999-12-31  0:00                     ` Richard D Riehle
2000-01-02  0:00             ` Tucker Taft
1999-12-17  0:00   ` Robert A Duff
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