W3C home > Mailing lists > Public > html-tidy@w3.org > April to June 2002

Using JTidy in threads with piped IO streams

From: Armin Braun <brar0013@fh-karlsruhe.de>
Date: Mon, 10 Jun 2002 17:01:03 +0200 (CEST)
To: html-tidy@w3.org
Message-ID: <Pine.A41.4.44.0206101640540.30490-100000@rz06.fh-karlsruhe.de>

G'day,

I'm currently working on a problem with JTidy and threads. Just the simple
producer-consumer example; I created two threads and let the first one
parse an URL stream with JTidy and write to an output stream, while the
other one reads this output from an input stream. I used the classes
PipedInputStream and PipedOutputStream to connect the two of them.
However, this won't work. The input stream connected to the outputstream
(the latter should be written by JTidy) doesn't seem to contain any data,
as I checked using its "available()" method. Outputting to a file e.g.
works perfectly; so it's not a reason of the original URL stream.
Sometimes it seems there's no data available, sometimes nothing happens as
if the threads were deadlocking each other. I tried as much as I could,
but nothing worked unfortunately.
Maybe someone has an idea of how to solve that problem, or even some
sample code to throw a glance at.

Any help is much appreciated.

Cheers,
Armin

--
< Armin Braun
< Karlsruhe University of Applied Sciences
< brar0013@fh-karlsruhe.de
Received on Monday, 10 June 2002 11:01:09 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 3 April 2012 06:13:52 GMT