comp.lang.ada
 help / color / mirror / Atom feed
From: James Rogers <jimmaureenrogers@worldnet.att.net>
Subject: Re: redirecting the standard output to different std outputs?
Date: Tue, 10 Apr 2001 20:38:14 GMT
Date: 2001-04-10T20:38:14+00:00	[thread overview]
Message-ID: <3AD36FB9.CA434512@worldnet.att.net> (raw)
In-Reply-To: 3AD3322E.7F2959EA@home.com


Mark Biggar wrote:
> 
> Frank wrote:
> > Is it possible to say that one task shall have one std output and another
> > task a different std output?
> > Eg. that two task (in the same Ada-program) can have std output to different
> > Xterm windows in Linux.
> 
> No, the Ada Io packages are not task save, or aware.  You can't even
> reliably write form two tasks to the same file with out imposing
> your own explicit locking protocol, such as using a protected
> object or a handler task.

On the other hand, it is possible to open each device (Xterm) as a
separate file, and write to that file in only one task. If this does
not meet your needs then consider creating one or more tasks whose
role is to output data. You could design those tasks to take their
input data either from an entry using the classical Ada rendezvous,
or using a protected object as a communication buffer. Tasks 
requiring output would simply call the entry on the task or the
protected object to "output" their data. The task actually writing
to the Xterm would respond to the data and perform the required
actions.

Jim Rogers
Colorado Springs, Colorado USA



  reply	other threads:[~2001-04-10 20:38 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-10 14:32 redirecting the standard output Martin Dowie
2001-04-10 15:01 ` redirecting the standard output to different std outputs? Frank
2001-04-10 16:17   ` Mark Biggar
2001-04-10 20:38     ` James Rogers [this message]
2001-04-13 16:23   ` Tucker Taft
2001-04-10 16:08 ` redirecting the standard output Stephen Leake
2001-04-10 16:46   ` Stephen Leake
2001-04-10 17:13     ` Smark
2001-04-10 21:00   ` Ted Dennison
2001-04-11  7:32   ` Martin Dowie
2001-04-11 12:04     ` Stephen Leake
2001-04-11 14:15       ` Martin Dowie
2001-04-12  1:41     ` tmoran
2001-04-12  7:08       ` Martin Dowie
2001-04-10 16:46 ` Smark
2001-04-11 12:06   ` Stephen Leake
2001-04-11 14:11     ` Martin Dowie
2001-04-11  0:04 ` Jeff Creem
2001-04-11  9:48 ` Graham Baxter
2001-04-12 12:23   ` Martin Dowie
2001-04-12 14:01     ` Smark
2001-04-12 19:52       ` martin.m.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