users@grizzly.java.net

Re: How to use TCPNIOAsyncQueueReader?

From: Oleksiy Stashok <oleksiy.stashok_at_oracle.com>
Date: Tue, 06 Sep 2011 09:06:19 +0200

Hi,

I think you have old Grizzly sources.
Please checkout the latest sources from Git repository:
git clone git://java.net/grizzly~git

Thanks.

WBR,
Alexey.

On 09/06/2011 04:55 AM, yelingbug wrote:
> Hi!
> Thanks for you replying.
>
> But I still have a question about 'AbstractNIOAsyncQueueReader' used in
> 'StandaloneProcessor'.
>
> For pieces of code as following:
>
> StandaloneProcessor#process(Context context):
> .......
> */ if (reader.isReady(connection)) {
> reader.processAsync(connection);/
> }*
> ......
>
> AbstractNIOAsyncQueueReader#processAsync(Connection connection):
> .........
> * /
> final Queue<AsyncReadQueueRecord> queue =
> connectionQueue.getQueue();
> final AtomicReference<AsyncReadQueueRecord> currentElement =
> connectionQueue.getCurrentElementAtomic();
> AsyncReadQueueRecord queueRecord = currentElement.get();
> --------(1)
> if (queueRecord == LOCK_RECORD) return;
>
> try {
> while (queueRecord != null) {
> --------(2)
> ...........
> }/*
>
> When execution gets to (2), I think that it will never get into the loop,
> because the variable
> of 'queueRecord' may always be null as there can't find any other places
> to initialize or set
> 'queueRecord' like
>
> */getCurrentElementAtomic().set(...)/*
>
> so am I right?
>
>
> yelingbug.
>
>
>
> --
> View this message in context: http://grizzly.1045725.n5.nabble.com/How-to-use-TCPNIOAsyncQueueReader-tp4769708p4772975.html
> Sent from the Grizzly - Users mailing list archive at Nabble.com.