Question about AsynchronousByteChannel.read()
Alan Bateman
Alan.Bateman at oracle.com
Tue Jul 19 06:38:51 PDT 2011
cowwoc wrote:
> :
> Couldn't steam-oriented channels simply queue incoming requests and handle
> them on a first-come first-serve basis?
>
That would mean the completion handlers could run concurrently or even
out of order and would be tricky to handle. With writing then it could
lead to corruption of the stream (esp. if multiple threads attemped to
initiate write operations to the stream at around the same time). For
now AsynchronousSocketChannel doesn't have any support for queuing of
I/O operations. It may be something we have to come back to in the
future. There is some prior discussion on this list about this topic
that may be useful.
-Alan
More information about the nio-dev
mailing list