From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.5-pre1 Path: eternal-september.org!reader02.eternal-september.org!gandalf.srv.welterde.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: set_index and and end_of_file with just a stream reference Date: Sat, 20 Feb 2021 19:56:33 -0600 Organization: JSA Research & Innovation Message-ID: References: <4d2daa8c-c159-48a4-bdf7-e9aa3b537bcan@googlegroups.com> Injection-Date: Sun, 21 Feb 2021 01:56:36 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="25936"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:61402 List-Id: "Dmitry A. Kazakov" wrote in message news:s0rbv0$dss$1@gioia.aioe.org... > On 2021-02-20 16:26, Mehdi Saada wrote: >> In term of design, I have a file inside a protected type, to ensure >> validity for concurrrent readings/writings. > > This is illegal ARM 9.5.1 (8) Formally, it is legal, but it isn't required to work - it might raise an exception if you do it. It can be made illegal in Ada 202x by setting Nonblocking => True on the protected type (that would have been better as the default from a programming perspective, but it would break a lot of existing code). > Use a mutex (based on a protected object) or a monitor (based on a task) > for mutually exclusion of blocking operations. Right. Randy.