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 09:51:58 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 11:55:49 -0500 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9rmm2n$q4e$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> <3bded21b$0$32589$626a54ce@news.free.fr> NNTP-Posting-Host: dhcp-200-133.miami.pace.co.uk X-Trace: nh.pace.co.uk 1004460951 26766 136.170.200.133 (30 Oct 2001 16:55:51 GMT) X-Complaints-To: newsmaster@news.cam.pace.co.uk NNTP-Posting-Date: 30 Oct 2001 16:55:51 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:15428 Date: 2001-10-30T16:55:51+00:00 List-Id: Seems like that might unreasonably lock up access to some object. Also, it isn't clear to me how this would make the object task safe? Assume you have a class that the constructor/destructor acquire some semaphore. It gets globally declared such that two threads can access its functions. Does each thread have to check/acquire the semaphore before write operations? Or do you code a check of the semaphore into all the critical paths? It isn't clear to me how this is supposed to work.... You could obviously do some sort of acquisition with controlled types - they provide the same sort of capabilities of constructors/destructors - but why would you want to if you have protected types? 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/ "Jean-Marc Bourguet" wrote in message news:3bded21b$0$32589$626a54ce@news.free.fr... > > 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. >