users@grizzly.java.net

Re: gateway nio migration guide to grizzly part2

From: Survivant 00 <survivant00_at_gmail.com>
Date: Mon, 16 Jun 2008 09:36:07 -0400

exactly.

I wanted to use Grizzly when I had to migrate a old gateway at my job, but I
didn't use NIO before, and I didn't just want to copy/paste code, I wanted
to know what I was doing. So I started my application using pure NIO
(blocking), and after that NIO nonblocking.. and the last step is pure
Grizzly.

and I wanted to create the code a simple as possible but still simulate a
real application. Most of the time you see Hello world sample, but they are
completed useless in readworld context.

and I want to create a complete guide after that.. explaining why I write
the line x in my code. I hope that will be used for people starting with
nio and grizzly.


***
I guess it could be a bad thing because you parsing and processing your
query on the main selector thread.
Depends on how long this parsing and processing takes....

***

That's my in the demo_v2 I use Queue to fastest the process. As soon the
query is parsing, it,s added to a queue to be process by another thread.

by I guess the next step was to use threadpool.

so I should change the code there :


// Check if a message has been sent
                    if (selKey.isValid() && selKey.isReadable()) {
                        ClientConnectionHandler connectionReader =
(ClientConnectionHandler)selKey.attachment();
                        connectionReader.read(); ****** put that in a
thread pool ?
                    }



2008/6/16 John ROM <snake-john_at_gmx.de>:

> Hi,
> If I understand you right you are preparing an tutorial in the following
> way:
>
> 1) You first want to show code which does NIO without Grizzly
>
> 2) You then want to migrate the code to Grizzly and show where Grizzly
> helps.
>
>
> >>> another question.. I did'n use ThreadPool in my application.. is it a
> bad thing ?
>
> I guess it could be a bad thing because you parsing and processing your
> query on the main selector thread.
> Depends on how long this parsing and processing takes....
>
> Of course a ThreadPool like used in Grizzly out of the box would help
> improve Concurrency
>
> many greetings
>
> --
> GMX startet ShortView.de. Hier findest Du Leute mit Deinen Interessen!
> Jetzt dabei sein: http://www.shortview.de/?mc=sv_ext_mf@gmx
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: users-help_at_grizzly.dev.java.net
>
>