comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@bix.com
Subject: Re: Assignment of limited private types...
Date: 31 Jan 1995 02:35:17 GMT
Date: 1995-01-31T02:35:17+00:00	[thread overview]
Message-ID: <3gk7l5$6r8@news1.delphi.com> (raw)

stevem@dcs.gla.ac.uk (Steve McGowan) wrote:
>
> I'd like to pass in a 'file_type' identifier into a task, make a local
> copy of this identifier within the task, and then write text to this
> file stream inside the task.
  If you did make local copies, what behavior would you expect when two
different tasks, using two copies of the file handle, simultaneously
wrote to the file?
  If you don't really want multiple copies of the file handle, how
about passing in the file name and letting the task open the file
locally, instead of passing in the file handle.
  If you do want multiple tasks to write to the file, but don't want
the bits randomly intermingled, you need to synchronize your tasks.
In that case, how about having a third task do all the IO on the
file, using Accepts to accept (one at a time) requests for IO from
the other tasks.
  In general, Ada rules are not arbitrary, and not there for the
convenience of the compiler writer, or to make your life hard.  If
you can't do something straightforwardly in Ada, it's usually
productive to think twice about whether the approach you're
taking is really the best one.



             reply	other threads:[~1995-01-31  2:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-01-31  2:35 tmoran [this message]
  -- strict thread matches above, loose matches on Subject: below --
1995-01-26 16:37 Assignment of limited private types Steve McGowan
1995-01-30 18:50 ` Theodore E. Dennison
1995-01-31  1:05   ` Henry Baker
1995-02-01 12:29   ` Robert Dewar
1995-02-07  2:23   ` Adam Beneschan
replies disabled

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