[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Note on PushbackInputStream
From: |
Tom Tromey |
Subject: |
Note on PushbackInputStream |
Date: |
06 Aug 2001 17:05:21 -0600 |
While merging PushbackInputStream this weekend, I found a bug in both
the Classpath and libgcj versions. Actually I think it is a a design
bug and not a bug in our implementations.
Suppose a thread calls PushbackInputStream.read and there are no bytes
to be read. So the thread blocks.
Now suppose another thread calls PushbackInputStream.unread.
Ideally you'd expect the first thread to wake up and read the
pushed-back bytes. However, this doesn't happen. And in fact it
isn't easy to make it happen. I think you could do it by making a new
thread inside PushbackInputStream.read. That is awfully heavy though.
Maybe the new 1.4 I/O stuff addresses this.
Tom
- Note on PushbackInputStream,
Tom Tromey <=
- Re: Note on PushbackInputStream, Bryce McKinlay, 2001/08/10
- Re: Note on PushbackInputStream, John Keiser, 2001/08/18
- Re: Note on PushbackInputStream, Dalibor Topic, 2001/08/19
- Re: Note on PushbackInputStream, Tom Tromey, 2001/08/20
- Re: Note on PushbackInputStream, Dalibor Topic, 2001/08/21
- Re: Note on PushbackInputStream, John Keiser, 2001/08/21
- Re: Note on PushbackInputStream, Stuart Ballard, 2001/08/21
- Re: Note on PushbackInputStream, John Keiser, 2001/08/21
- Re: Note on PushbackInputStream, Tom Tromey, 2001/08/21
- Re: Note on PushbackInputStream, Dalibor Topic, 2001/08/22