comp.lang.ada
 help / color / mirror / Atom feed
From: Richard D Riehle <laoXhai@ix.netcom.com>
Subject: Re: Ada Protected Object Tutorial #1
Date: 1999/12/31
Date: 1999-12-31T20:41:49+00:00	[thread overview]
Message-ID: <84j4ed$8cq$1@nntp6.atl.mindspring.net> (raw)
In-Reply-To: 848rus$s6v$1@nnrp1.deja.com

In article <848rus$s6v$1@nnrp1.deja.com>,
	Robert Dewar <robert_dewar@my-deja.com> wrote:

>A semaphore is a particular synchronization mechanism with
>advantages and disadvantages.

Lots of disadvantages.  More than commonly noted.  This is 
especially true when using languages other than Ada or when
using certain embedded R/T OS.   I ran across a very nice
exposition of this issue last week while browsing through
a new book, "An Embedded Systems Primer," my David Simon. 
This, by the way, is a good book for an introductory course
on embedded systems programming, although there is no mention
of Ada.  

>A protected object is a language mechanism for CREATING
>synchrnonization mechanisms.

Agreed.  Is it always the best choice?  Not sure.  When should
one use the semaphores provided by an embedded O/S, or the hardware
semaphores available in some environments?   

>Indeed a very standard example of the use of protected types
>is to implement a standard semaphore.

Yes, this is a common example and it sometimes leads the designer
away from the more robust option of a fully encapsulated set of
values.  

If one is determined to implement a semaphore, a protected object is a
better choice than a task.   However, Burns and Wellings in "Concurrency 
in Ada" note that  full encapsulation is the real value of a protected
resource, and express caution about low-level mechanisms such as
semaphores versus the reliability of a "monitor" mechanism a la the
protected object.   

Richard Riehle




  reply	other threads:[~1999-12-31  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         ` 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-18  0:00           ` Robert A Duff
1999-12-18  0:00             ` Kaz Kylheku
1999-12-18  0:00         ` Karel Th�nissen
1999-12-18  0:00           ` Laurent Guerby
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               ` 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 [this message]
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