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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Safety of unprotected concurrent operations on constant objects Date: Tue, 13 May 2014 17:46:58 +0100 Organization: A noiseless patient Spider Message-ID: References: <83ha6vuynrzs.1jk08faxb8mnl.dlg@40tude.net> <1jebi7cf92ak4.1trmstj8qi3wm.dlg@40tude.net> <1i6pyg077xlrv.vnwotzzgb0ut$.dlg@40tude.net> <10pk27v48vhcb$.1qkf6roq2yzjn$.dlg@40tude.net> <1qq0ryc8c4l2m.1driqwwiwwl02.dlg@40tude.net> <%vhcv.255737$s87.168969@fx11.iad> <30rcv.17381$Nf2.13630@fx01.iad> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="942b5624700b15f09a730d9ed9406bd7"; logging-data="18194"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+FuR/Fa+EpATz7xL/D4iq3YxGjD5BWaIk=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:81NdnCHr35iMUSCtfV2FIitBsVQ= sha1:YtxfxND+S/8yiVMHgJ8x7bv/bso= Xref: news.eternal-september.org comp.lang.ada:19803 Date: 2014-05-13T17:46:58+01:00 List-Id: Brad Moore writes: > That may be why Ada has PO's in the standard, but does not provide any > mutex libraries like the one you suggest; They are too error > prone. I'd be surprised if mutexes and scope locks like the one in > your example wouldn't have been considered for inclusion in the > standard at some point during the history of Ada. Ada does provide > the building blocks that programmers can create such abstractions > however, which programmers are then free to use as they wish. I've several times seen Randy recommend use of the Containers as a way of avoiding problems with memory allocation/deallocation, and I'd have thought simple mutexes/locks would be just as much candidates to support the general user. Are they error-prone? If Joe Programmer reinvents locking, what's the chance that there's something wrong with it?