gotcha. that does sound strange. I just wrote a little program to test that
and found out that's also true for Windowz. no probs reading same file
simultaneously using two BufferedInputStream objects. strange, huh?
zm.

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Christopher K. St. John
Sent: Wednesday, January 16, 2002 2:50 AM
To: [EMAIL PROTECTED]
Subject: Re: Downloading files with jsp/servlets...


Zvika Markfeld wrote:
>
> apparently Brian meant that two
> BufferedInputStream objects cannot access the same file simultaneously.
> Meaning, it is the file that is actually synched, not the Stream object...
>

 I'd have to re-read the whole thread in detail to be
sure, but I don't think that makes sense. I mean, if
that were true, then there would be no way to fix it
by using a "non-synchronized" BufferedInputStream, right?

 And anyway, he said he was using Linux on a x86 box.
I use Linux as one of my dev platforms, and unless he's
using some really bizarre JVM, then I can guarantee you
it doesn't work that way.

 I suspect he was hitting random variations in how his
threads were getting scheduled, resulting in one thread
briefly getting most of the bandwidth. Or maybe they
were running one set of tests with native threads, and
another with green threads. There's not really enough
data to draw a conclusion.

 But it wasn't a problem with BufferedInputStream.


--
Christopher St. John [EMAIL PROTECTED]
DistribuTopia http://www.distributopia.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to