From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 114c38,b2077f5b728fb9af X-Google-Attributes: gid114c38,public X-Google-Thread: 103376,b2077f5b728fb9af X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-04-10 13:40:05 PST Path: supernews.google.com!sn-xit-03!supernews.com!logbridge.uoregon.edu!news.maxwell.syr.edu!wn1feed!worldnet.att.net!135.173.83.72!wnfilter2!worldnet-localpost!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Message-ID: <3AD36FB9.CA434512@worldnet.att.net> From: James Rogers X-Mailer: Mozilla 4.76 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada,comp.os.vxworks Subject: Re: redirecting the standard output to different std outputs? References: <3ad31759$1@pull.gecm.com> <3AD3322E.7F2959EA@home.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Date: Tue, 10 Apr 2001 20:38:14 GMT NNTP-Posting-Host: 12.74.130.151 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 986935094 12.74.130.151 (Tue, 10 Apr 2001 20:38:14 GMT) NNTP-Posting-Date: Tue, 10 Apr 2001 20:38:14 GMT Organization: AT&T Worldnet Xref: supernews.google.com comp.lang.ada:6727 comp.os.vxworks:6389 Date: 2001-04-10T20:38:14+00:00 List-Id: 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