comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Dewar <robert_dewar@my-deja.com>
Subject: Re: Tasking differences
Date: 2000/07/12
Date: 2000-07-12T00:00:00+00:00	[thread overview]
Message-ID: <8kgkdp$kjv$1@nnrp1.deja.com> (raw)
In-Reply-To: 8kff0n$nnu$1@nnrp1.deja.com

In article <8kff0n$nnu$1@nnrp1.deja.com>,
  Ted Dennison <dennison@telepath.com> wrote:

> Hmm. That makes perfect sense, and would fully explain the
> behavior. Most Ada runtimes have a little problem where
> Ada.Text_IO is not thread-safe.

That's misleading. Ada.Text_IO is required to be thread safe,
and it would be surprising if it were not the case. Probably
what you are referring to is having two tasks use Ada.Text_IO
*on the same file* without any protection, but that's clearly
an unsychronized use of a shared variable, so the program is
erroneous. The "little problem" is in the client!

> It would be fairly easy to make it thread-safe by
> creating a task or protected object to synchornize accesses to
> it. I've often wondered why more vendors didn't do that.

Because

  a) there is no requirement in the RM to do this
  b) the programs you are talking about are erroneous
  c) this kind of locking is expensive

Certainly if the problem is that you have multiple tasks doing
Put to the same file without synchronization, then absolutely
anything may happen when you run the program!


Sent via Deja.com http://www.deja.com/
Before you buy.




       reply	other threads:[~2000-07-12  0:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3969B65A.46942054@baesystems.com>
     [not found] ` <uk8etc788.fsf@baesystems.com>
     [not found]   ` <8kff0n$nnu$1@nnrp1.deja.com>
2000-07-12  0:00     ` Robert Dewar [this message]
2000-07-12  0:00       ` Tasking differences Larry Kilgallen
2000-07-12  0:00         ` Robert Dewar
2000-07-13  0:00           ` Larry Kilgallen
2000-07-13  0:00             ` Robert Dewar
2000-07-12  0:00       ` Ted Dennison
2000-07-12  0:00         ` Robert Dewar
     [not found] ` <8ke8ao$rs3$1@nnrp1.deja.com>
     [not found]   ` <396AECA4.30B03835@baesystems.com>
2000-07-12  0:00     ` Robert Dewar
2000-07-12  0:00       ` Martin Dowie
replies disabled

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