comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Is Text_IO.Put_Line() thread-safe?
Date: Sat, 16 Jun 2012 10:14:33 +0200
Date: 2012-06-16T10:14:33+02:00	[thread overview]
Message-ID: <15ejiqzwmm28q.1pq77vn14l7h3.dlg@40tude.net> (raw)
In-Reply-To: m2wr37iszn.fsf@pushface.org

On Sat, 16 Jun 2012 09:03:08 +0100, Simon Wright wrote:

> "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> writes:
> 
>> On Sat, 16 Jun 2012 07:49:26 +0100, Simon Wright wrote:
>>
>>> "J-P. Rosen" <rosen@adalog.fr> 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.

When debugging you should not pump the stack and heap too much. You also
would not like to keep it in the volatile memory for too long, because the
thing might crash before that reaches the hard drive or monitor.

>> 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.

Yes, RT is one case where one wanted to convert a synchronous operation
into an asynchronous one. But that is a design decision motivated by more
than mere task-safety reasons.

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



  reply	other threads:[~2012-06-16  8:14 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-14 12:53 Is Text_IO.Put_Line() thread-safe? awdorrin
2012-06-14 13:49 ` Robert A Duff
2012-06-14 14:35   ` Adam Beneschan
2012-06-14 14:38   ` Dmitry A. Kazakov
2012-06-14 14:56     ` J-P. Rosen
2012-06-14 16:01       ` Dmitry A. Kazakov
2012-06-14 18:34       ` Robert A Duff
2012-06-21 19:01         ` Randy Brukardt
2012-06-14 18:29     ` Robert A Duff
2012-06-21 19:04       ` Randy Brukardt
2012-06-14 21:14     ` tmoran
2012-06-14 14:42   ` awdorrin
2012-06-14 18:24     ` Robert A Duff
2012-06-14 20:37       ` awdorrin
2012-06-14 21:37         ` Robert A Duff
2012-06-15  5:32           ` Georg Bauhaus
2012-06-15  7:22             ` Dmitry A. Kazakov
2012-06-15 21:32               ` Robert A Duff
2012-06-16  7:41                 ` Dmitry A. Kazakov
2012-06-15 21:27             ` Robert A Duff
2012-06-14 18:56 ` Jeffrey Carter
2012-06-14 20:50   ` awdorrin
2012-06-14 21:41     ` Robert A Duff
2012-06-15 12:39       ` awdorrin
2012-06-14 22:17     ` Jeffrey Carter
2012-06-14 22:40       ` Simon Wright
2012-06-14 23:35         ` Jeffrey Carter
2012-06-15  5:04           ` Simon Wright
2012-06-15  5:41             ` Jeffrey Carter
2012-06-21 19:20             ` Randy Brukardt
2012-06-16  2:00       ` BrianG
2012-06-16  6:04         ` J-P. Rosen
2012-06-16  6:49           ` Simon Wright
2012-06-16  7:58             ` Dmitry A. Kazakov
2012-06-16  8:03               ` Simon Wright
2012-06-16  8:14                 ` Dmitry A. Kazakov [this message]
2012-06-21 19:27               ` Randy Brukardt
2012-06-16  7:51           ` Dmitry A. Kazakov
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox