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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,534dd301375921ac X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.190.104 with SMTP id gp8mr3722736pbc.4.1339709872209; Thu, 14 Jun 2012 14:37:52 -0700 (PDT) Path: l9ni51279pbj.0!nntp.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!bloom-beacon.mit.edu!newsswitch.lcs.mit.edu!nntp.TheWorld.com!.POSTED!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Is Text_IO.Put_Line() thread-safe? Date: Thu, 14 Jun 2012 17:37:51 -0400 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: <93201f1a-d668-485e-83b4-492bc283f36e@googlegroups.com> <546fc310-c898-417a-9c92-a5b12ef32591@googlegroups.com> NNTP-Posting-Host: shell01.theworld.com Mime-Version: 1.0 X-Trace: pcls6.std.com 1339709871 9905 192.74.137.71 (14 Jun 2012 21:37:51 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Thu, 14 Jun 2012 21:37:51 +0000 (UTC) User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (irix) Cancel-Lock: sha1:FNvva1YpAe8tgRHRiMxXLOCEjgI= Content-Type: text/plain; charset=us-ascii Date: 2012-06-14T17:37:51-04:00 List-Id: awdorrin writes: > That is what I mean, if the Text_IO.Put_Line isn't thread-safe, and > its picking up data from the array being sorted in the other thread, > and printing it, then it very well could have written the information > it was supposed to be printing to the screen, into that array that was > being sorted... Anything could be corrupted. Yes. It doesn't seem likely to me, but it could happen. More likely (I'm guessing) is that there's another bug, somewhere other than the Put_Lines. > I really cannot believe that the Put_Line's aren't thread safe. Yes, there are several things wrong with the design of Text_IO, and this is one of them. But it's not too hard to work around it. - Bob