Volatile fields in the decoders
Christian Migowski
chrismfwrd at gmail.com
Mon Nov 9 02:15:33 EST 2009
Hi Trustin,
did you make attempts to measure the penalty the decoders get from volatile?
The Netty-decoders don't do I/O therefor it is in most cases not
necessary to run them in different ExecutionHandler threads, but if
someone does, he _may_ get in trouble when the volatile is missing.
I didn't do any testing, but I have the feeling that removing volatile
will not improve performance measurably, but doing so potentially
dangers correct thread-safety of the decoders, i.e. i would keep it.
regards,
christian!
On Sat, Nov 7, 2009 at 6:24 PM, Frederic Bregier <fredbregier at free.fr> wrote:
>
> Hi Trustin,
>
> For me; I agree that most of the time, Codec are before ExecutionHandler.
> In fact, I have no real idea of other cases, except, if I search the extreme case, when one wants to "pipeline" two kinds of channels, for instance:
> "network-channel -> one codec -> execution handler -> business handler which writes on local-channel -> another codec -> another execution handler -> another business handler"
>
> I do this to pipeline several "business" stream into one network-channel.
> My guess is that probably there the codec for the local channel (the one in the middle named another codec) must be ok for multiple thread suport.
> Perhaps not all codec are necessary for that.
> Also I'm not completely sure that my example is a good one.. Just a guess more than an example...
> WDYT ?
>
> Frederic
> ----- Original Message -----
> From: Trustin Lee [via Netty Forums and Mailing Lists]
> To: Frederic Bregier
> Sent: Saturday, November 07, 2009 3:47 PM
> Subject: Volatile fields in the decoders
>
>
> Hi folks,
>
> Currently, all decoders distributed with Netty define their state
> fields as volatile, because I assumed that the decoders might be
> placed after ExecutionHandler. However, nobody seem to place them
> after ExecutionHandler because decoding is a CPU bound task.
> Therefore, I'd like to remove the volatile modifier if I did not miss
> anything. Please feel free to post your idea - it will be very
> helpful regardless whether it's agreement or disagreement.
>
> Thanks
>
> — Trustin Lee, http://gleamynode.net/
>
> _______________________________________________
> netty-dev mailing list
> [hidden email]
> https://lists.jboss.org/mailman/listinfo/netty-dev
>
> — Trustin Lee, http://gleamynode.net/
>
>
>
> ------------------------------------------------------------------------------
>
> View message @ http://n2.nabble.com/Volatile-fields-in-the-decoders-tp3964373p3964373.html
> To start a new topic under Netty Developer Group, email ml-node+685710-1546594857 at n2.nabble.com
> To unsubscribe from Netty Developer Group, click here.
>
>
>
> -----
> Hardware/Software Architect
> --
> View this message in context: http://n2.nabble.com/Volatile-fields-in-the-decoders-tp3964373p3964949.html
> Sent from the Netty Developer Group mailing list archive at Nabble.com.
>
> _______________________________________________
> netty-dev mailing list
> netty-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-dev
>
More information about the netty-dev
mailing list