users@grizzly.java.net

Message decoding threading strategy

From: Bo Li <bo.l.li_at_oracle.com>
Date: Mon, 23 Aug 2010 16:44:46 -0500

Hi Alexey

Is there a supported way to implement something like the leader-follower
threading strategy but with decoding messages on the same connection?
What I mean is we would like to decode only one PDU of the protocol with
the Grizzly worker thread and continue processing of the decoded PDU on
the same thread while letting another Grizzly worker thread decode
additional PDUs (if any) in the read buffer or process additional read
events on the connection.

We are interested in this because we want to separate PDU decoding and
processing without having to hand over the processing task to another
thread. It seems like the overhead of additional queuing and invoking of
the task in another thread pool causes a 13% degradation in throughput.

Thanks
Bo