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.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8eff44ec1bcf8433 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-10-30 08:15:46 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!opentransit.net!wanadoo.fr!proxad.net!feeder2-1.proxad.net!news2-1.free.fr!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Container reqs References: <9qctpn$lil$1@news.huji.ac.il> <3BCC01B1.18C18C98@free.fr> <3BCC6CB7.20BAA30D@boeing.com> <9qi2c8$gpb$1@nh.pace.co.uk> From: Jean-Marc Bourguet Date: 30 Oct 2001 17:14:28 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <3bded21b$0$32589$626a54ce@news.free.fr> Organization: Guest of ProXad - France NNTP-Posting-Date: 30 Oct 2001 17:15:23 MET NNTP-Posting-Host: 158.140.208.29 X-Trace: 1004458523 news2-1.free.fr 32589 158.140.208.29 X-Complaints-To: abuse@proxad.net Xref: archiver1.google.com comp.lang.ada:15417 Date: 2001-10-30T17:15:23+01:00 List-Id: Barry Kelly writes: > In article <9qi2c8$gpb$1@nh.pace.co.uk> > "Marin David Condic" > wrote: > > > If you wish to keep the realtime/embedded crowd happy, you need to have > > task-safe versions. > > C++ can implement task safety using the RAII (resource aquisition is > initialization) idiom, which eliminates the need for creating a whole > new type for task-safe access to structures. > > Why can't Ada do this? Ada can do it as well as C++ -- see controlled types. (For cla people unused to RAII, it is the idiom where the constructor acquire a ressource and the destructor free it). But if you want to use it, you have to rely on the user to acquire the lock, so instead you define a new type providing only protected operation, like in Ada. -- Jean-Marc