G
Giovanni Azua
Hi all,
I need to build a Client-Middleware-Database architecture in the context of
a course in my grad studies. In a nutshell, multiple Client component
instances connect and send random DML statements to multiple Middleware
(server) which in turn execute those DML against a Database server and send
the results back to the Clients. After carefully studding the description
and requirements I have two choices for the communication between the Client
and Middleware:
- Classic sockets + thread pool.
- NIO multiplexing.
I think I will end implementing both but I am curious in the case of the NIO
multiplexing: in your experience would it increase performance to setup a
Thread Pool and associate one SelectionKey to one specific Thread in the
pool so that all read/write operations for each specific channel go through
one specific Thread from the Pool? From all code examples/tutorials/books I
have reviewed online the "Selector Thread" seems like a bottleneck to me. I
haven't seen this approach anywhere so that's why I am asking.
Thanks in advance,
Best regards,
Giovanni
PS: first time I post from Entourage .. hope the formatting etc is not too
horrible.
I need to build a Client-Middleware-Database architecture in the context of
a course in my grad studies. In a nutshell, multiple Client component
instances connect and send random DML statements to multiple Middleware
(server) which in turn execute those DML against a Database server and send
the results back to the Clients. After carefully studding the description
and requirements I have two choices for the communication between the Client
and Middleware:
- Classic sockets + thread pool.
- NIO multiplexing.
I think I will end implementing both but I am curious in the case of the NIO
multiplexing: in your experience would it increase performance to setup a
Thread Pool and associate one SelectionKey to one specific Thread in the
pool so that all read/write operations for each specific channel go through
one specific Thread from the Pool? From all code examples/tutorials/books I
have reviewed online the "Selector Thread" seems like a bottleneck to me. I
haven't seen this approach anywhere so that's why I am asking.
Thanks in advance,
Best regards,
Giovanni
PS: first time I post from Entourage .. hope the formatting etc is not too
horrible.