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,UTF8 Received: by 10.68.223.40 with SMTP id qr8mr8963443pbc.0.1339833787991; Sat, 16 Jun 2012 01:03:07 -0700 (PDT) Path: l9ni56577pbj.0!nntp.google.com!news2.google.com!goblin1!goblin.stu.neva.ru!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: Is Text_IO.Put_Line() thread-safe? Date: Sat, 16 Jun 2012 09:03:08 +0100 Organization: A noiseless patient Spider Message-ID: References: <93201f1a-d668-485e-83b4-492bc283f36e@googlegroups.com> <3fff1269-06f5-47a2-bc10-c2145b3a297d@googlegroups.com> <17b8mcqy4f63k$.1jwvmc6qjjvnq$.dlg@40tude.net> Mime-Version: 1.0 Injection-Info: mx04.eternal-september.org; posting-host="VkRmmmXzMj956AdxXtqrqg"; logging-data="3610"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/eVXw/LsI4vmcuat7eYVWlLZckHVnVg6k=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (darwin) Cancel-Lock: sha1:UshvYNVg6oiZhRKjUecahwuEzz4= sha1:nwCYxia8pAm5WEh6KMJCXDd+7Ww= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Date: 2012-06-16T09:03:08+01:00 List-Id: "Dmitry A. Kazakov" writes: > On Sat, 16 Jun 2012 07:49:26 +0100, Simon Wright wrote: > >> "J-P. Rosen" writes: >> >>> 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. >>> >>> By all means, use a task and a rendezvous! Simple, no problem, it >>> works. PO are for simple, relatively low level stuff (in >>> general). Rendezvous are generally better for high level >>> synchronization. >> >> I feel more comfortable it the output requests are queued, so a PO >> wrapping a queue with an outputter task seems natural. > > That would need marshaling. Rendezvous and mutexes are great because > they copy nothing. So? this is usually for debug. > IMO, queues should only be used for asynchronous scenarios. In my scenario, getting the log information out is lower-priority than handling the real-time processing. You May Not Block while processing events.