comp.lang.ada
 help / color / mirror / Atom feed
From: kaz@ashi.footprints.net (Kaz Kylheku)
Subject: Re: Ada Protected Object Tutorial #1
Date: 1999/12/19
Date: 1999-12-19T00:00:00+00:00	[thread overview]
Message-ID: <slrn85om2b.dog.kaz@ashi.FootPrints.net> (raw)
In-Reply-To: 83hi68$75k$1@nntp4.atl.mindspring.net

On 19 Dec 1999 03:07:52 GMT, swhalen@netcom.com <swhalen@netcom.com> wrote:
>In comp.lang.ada Kaz Kylheku <kaz@ashi.footprints.net> wrote:
>...
>: It is a cost. I'm not convinced that it's not a cost that is also present
>: in Ada implementations, albeit hidden from the programmer. Unless the Ada
>: implementation has complete control over thread scheduling, 
>  which is obviously
>: not true of Ada implementations that run on top of many kinds of operating
>: systems.
>...
>
>This "clairvoyance" we seem to be talking about is _not_ "hidden from
>the programmer".  In Ada you (the programmer) pay a one time "price"
>in learning the Ada95 language and you get the benefit of some very
>well thought out tools like protected objects.
>
>Once you pay the price of learning how to use Ada95 properly, you gain
>the benefit of the compiler and run-time being able to handle many
>common situations without the comiler having to ever call any
>underlying operating system facility at all. Thus there is a genuine
>reduction in overhead compared to using POSIX or other system
>facilities in the manner you discuss.

POSIX is an interface which can also be implemented such that it handles common
situations without calling into an operating system.  A trivial example of that
would be seizing a pthread_mutex_t lock when there is no contention.
The POSIX threading functions are not necessarily system calls.

Just because something is not built into the language syntax, and the name
of its specification rhymes with UNIX doesn't mean that it's a call into the
opearting system.

> Ada95's tools do _not_ try to
>cover all situations, but try to cover many of the problems most
>commonly encountered in the real world.

The protected types as described are utterly useless to me because of the
limitations of what they can do. I can't think of any software I have written
in the past two years in which protected types could have been applied (had I
been working in Ada). In almost everything I have done, there are complex
relationship among the collaborating objects. There are calls among the objects
from within critical regions, as well as condition waits in arbitrary places.

>In otherwords: the Ada95 programmer pays a price in the discipline of
>knowing the language and using it properly.

Non sequitur. I was talking about the cost of implementing specific semantics,
such as atomically passing ownership of a locked object to a specific thread so
that the thread doesn't have to re-evaluate a predicate. Not some human
resource cost of learning. I don't appreciate people going wishy washy on me in
a technical debate.

The fact is, if you have a thread running on another processor that is about to
seize a lock, and you have to suspend that thread because the current owner is
passing ownership of the lock to some specific thread, that is a waste of
processor time. 

I'd like to hear from somone who has experience with these so-called protected 
types on a machine with 16 processors or more. What is the scalability like of
existing implementations?




  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         ` Karel Th�nissen
1999-12-18  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-24  0:00       ` Kenneth Almquist
1999-12-17  0:00   ` Robert A Duff
1999-12-17  0:00     ` Vladimir Olensky
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 [this message]
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               ` 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-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