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.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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 Received: by 10.68.238.65 with SMTP id vi1mr8936936pbc.7.1339833121365; Sat, 16 Jun 2012 00:52:01 -0700 (PDT) Path: l9ni56550pbj.0!nntp.google.com!news1.google.com!news.glorb.com!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Is Text_IO.Put_Line() thread-safe? Date: Sat, 16 Jun 2012 09:51:50 +0200 Organization: cbb software GmbH Message-ID: <13s745cm43h$.w4oy87yh4w9b$.dlg@40tude.net> References: <93201f1a-d668-485e-83b4-492bc283f36e@googlegroups.com> <3fff1269-06f5-47a2-bc10-c2145b3a297d@googlegroups.com> Reply-To: mailbox@dmitry-kazakov.de NNTP-Posting-Host: 4RFYTQ6jM/dAKFJoI0fUkg.user.speranza.aioe.org Mime-Version: 1.0 X-Complaints-To: abuse@aioe.org User-Agent: 40tude_Dialog/2.0.15.1 X-Notice: Filtered by postfilter v. 0.8.2 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Date: 2012-06-16T09:51:50+02:00 List-Id: On Sat, 16 Jun 2012 08:04:47 +0200, J-P. Rosen wrote: > Le 16/06/2012 04:00, BrianG a �crit : >> On the Put_Line issue, why not simply wrap it in a protected object > Because all IO's are potentially blocking operations. And even if they would not be, one should keep protected actions as short as possible. > By all means, use a task and a rendezvous! An alternative is a reentrant mutex seized and released by a controlled holder object. > Simple, no problem, it works. > PO are for simple, relatively low level stuff (in general). Rendezvous > are generally better for high level synchronization. Yes, but also significantly slower. Usually some combination of both is the best solution. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de