From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fb45e48e8dddeabd X-Google-Attributes: gid103376,public X-Google-Thread: ffc1e,fb45e48e8dddeabd X-Google-Attributes: gidffc1e,public From: swhalen@netcom.com Subject: Re: Ada Protected Object Tutorial #1 Date: 1999/12/19 Message-ID: <83hi68$75k$1@nntp4.atl.mindspring.net>#1/1 X-Deja-AN: 562516892 References: <839toq$pu$1@bgtnsc03.worldnet.att.net> <385AC716.7E65BD5C@averstar.com> Organization: ? User-Agent: tin/pre-1.4-19990517 ("Psychonaut") (UNIX) (SunOS/4.1.4 (sun4m)) Newsgroups: comp.programming.threads,comp.lang.ada Date: 1999-12-19T00:00:00+00:00 List-Id: In comp.lang.ada Kaz Kylheku 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. 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. In otherwords: the Ada95 programmer pays a price in the discipline of knowing the language and using it properly. In return you get a certain amount of "clairvoyance" in that the compiler can and does do some of the things you've been assuming it cannot do (which C or C++ or POSIX can't do). It's not magic: it's the benefit of a rigorously defined set of semantics that allow the compiler to "know" that it can control certain things you are used to turning over to POSIX or another API to the OS. Steve -- {===--------------------------------------------------------------===} Steve Whalen swhalen@netcom.com {===--------------------------------------------------------------===}