Question about AsynchronousByteChannel.read() (original) (raw)

cowwoc cowwoc at bbs.darktech.org
Tue Jul 19 08:33:42 PDT 2011


On 19/07/2011 10:45 AM, Alan Bateman-2 [via nio-dev] wrote:

cowwoc wrote: > > ... How so? If we queue incoming requests, only one operation runs > at a time. Completion handlers are guaranteed to return in the order > in which they were submitted. Am I missing something? If by "return" you mean execute then there isn't any guarantee. Even today if you initiate two read operations in quick succession, and if you specify two different completion handlers that just print a trace message, then it's possible that they the trace messages will not be printed in the order that you expect.

-Alan.

------------------------------------------------------------------------ If you reply to this email, your message will be added to the discussion below: http://nio-dev.3157472.n2.nabble.com/Question-about-AsynchronousByteChannel-read-tp6570959p6599032.html To unsubscribe from Question about AsynchronousByteChannel.read(), click here <http://nio-dev.3157472.n2.nabble.com/template/NamlServlet.jtp?macro=unsubscribebycode&node=6570959&code=Y293d29jQGJicy5kYXJrdGVjaC5vcmd8NjU3MDk1OXwxNTc0MzIxMjQ3>.

 Don't I get to make that guarantee as the Channel implementer? I 

can use a single consumer thread for reads, thereby guaranteeing that requests will be honored in the order they are submitted.

Gili

-- View this message in context: http://nio-dev.3157472.n2.nabble.com/Question-about-AsynchronousByteChannel-read-tp6570959p6599194.html Sent from the nio-dev mailing list archive at Nabble.com. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20110719/dae71158/attachment.html



More information about the nio-dev mailing list