From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=BAYES_00,XPRIO autolearn=no autolearn_force=no version=3.4.6 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: Adacore joins with Ferrous Systems to support Rust Date: Mon, 14 Feb 2022 17:25:54 -0600 Organization: JSA Research & Innovation Message-ID: References: <87o83pzlvm.fsf@nightsong.com> <87d2e0c1-c851-43e2-a085-fad30e475e35n@googlegroups.com> <70f72b7e-1f3f-4942-b6aa-1044430bdcd9n@googlegroups.com> Injection-Date: Mon, 14 Feb 2022 23:25:55 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="7746"; 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:63522 List-Id: "Alejandro R. Mosteo" wrote in message news:su8ts8$fej$1@dont-email.me... > On 12/2/22 6:22, John Perry wrote: ... >> I haven't played with Ada's task & rendezvous mechanisms in a long time. >> Do they guarantee an absence of data races? > > Not for global variables, yes for task-local ones. For any decent design > you'd encapsulate any shared data in a protected object or task, which > would give the same assurance as the bit you quoted for Rust. Then there's > Pragma Detect_Blocking, but that will only work for protected operations, > and two tasks getting in a mutual deadlock needs not to involve protected > operations. Ada 2022 has "conflict checking" to detect and reject bad uses of global variables. It's especially important for the parallel constructs (for which you don't have the syntactic guardrails that you get with tasks. It doesn't prevent every data race, but it eliminates most of them. (You can still get in trouble with accesses to multiple objects; that isn't necessarily safe even if accesses to the individual objects are.) But, so far as I know, GNAT doesn't implement it yet. Randy.