comp.lang.ada
 help / color / mirror / Atom feed
* Re: Assignment of limited private types...
@ 1995-01-31  2:35 tmoran
  0 siblings, 0 replies; 6+ messages in thread
From: tmoran @ 1995-01-31  2:35 UTC (permalink / 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.



^ permalink raw reply	[flat|nested] 6+ messages in thread
* Assignment of limited private types...
@ 1995-01-26 16:37 Steve McGowan
  1995-01-30 18:50 ` Theodore E. Dennison
  0 siblings, 1 reply; 6+ messages in thread
From: Steve McGowan @ 1995-01-26 16:37 UTC (permalink / raw)


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.

But I cannot do this since 'file_type' is limited private.

Any ideas how I can pass in this identifier, and to write to it
locally?

I want to do something like..

------------------------------

task body Run_Full_Experiment_TASK is
.
local_summary_stream : file_type;
.
begin

    accept start(summary_stream : in file_type) do
	local_summary_stream:=summary_stream;
    end start;

    -- ...then use 'local_summary_stream' to write my output.
    --
end Run_Full_Experiment_TASK;

-----------------------------


Thanks.

--Steve.



------------------------------------------------------------------------------

		I think we're in for a bad spell of wether.

------------------------------------------------------------------------------



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1995-02-07  2:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-01-31  2:35 Assignment of limited private types tmoran
  -- strict thread matches above, loose matches on Subject: below --
1995-01-26 16:37 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

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