Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A strange problem with output streams

Status
Not open for further replies.

rushtosiva

Programmer
Dec 5, 2000
7
US
All,
I am having a very strange problem with output streams on JDK1.1.8 (also on JDK1.1.7) on HP-UX B10.20. I really cannot make out anything from this:
I have a program - that is printing quite a lot of stuff and also doing quite a lot of things. This program was stalling sporadically - when I used to have some statements printed using "System.out.println". This problem of stalling used to go out as soon as I put in some more "println"s. Assuming it to be a problem with buffer flushing - I put in System.err.println instead of the System.out.println - obviously I did not replace all the System.out.printlns - but a few of them just before the step where the program used to stall. This problem still remained. Then, I put in quite a few dots to be printed in the line that was being printed using "System.err.println" (previously System.out.println) before the application stalled. Now, everything starts working. Assuming this to be a problem with the buffer of System.out not getting flushed - I tried putting in System.out.flush() - but to no avail. Flushing System.err also did not help. Now, I am at a loss. There is no guarantee - that with some changes in the things that are getting printed - I will not land up in the same problem of the application stalling. I will be highly obliged - if anyone can point me to the mistake that I am making.

Thanks a lot to all in anticipation,

Regards,
siva
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top