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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no 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:01:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!psinet-eu-nl!psiuk-p4!psiuk-p3!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Container reqs Date: Tue, 30 Oct 2001 09:53:09 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9rmesn$n0e$1@nh.pace.co.uk> References: <9qctpn$lil$1@news.huji.ac.il> <3BCC01B1.18C18C98@free.fr> <3BCC6CB7.20BAA30D@boeing.com> <9qi2c8$gpb$1@nh.pace.co.uk> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1004453591 23566 136.170.200.133 (30 Oct 2001 14:53:11 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 30 Oct 2001 14:53:11 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:15415 Date: 2001-10-30T14:53:11+00:00 List-Id: Well, it can. The thing is you have to ask "What do you mean by task safety?" For relatively simple subprograms and data, you might get by with reentrancy and atomic access to global data. For more complex data structures, you have to protect updates more thoroughly within protected types. You have to understand the issues surrounding the particular data you are accessing and the algorithms you are using to access the data. You either have, or can create mechanisms for handling it - but you need to understand tasks and protected types. I am afraid I don't know what the RAII idiom is all about so I don't know if there is a direct parallel in Ada. But I don't know of any C++ construct that does a) Tasking and/or b) Protected types so I imagine if you want true thread safety, you've got to implement some kind of semaphore or locking mechanism - which can become butt-ugly and lead to some interesting mutex bugs. Can you elaborate? MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Barry Kelly" wrote in message news:m7jsttod28l58b9betgcm8n6q5lue6oo5o@4ax.com... > 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? > > -- Barry