Volatile fields in the decoders

Trustin Lee (이희승) trustin at gmail.com
Mon Nov 9 02:42:07 EST 2009


Hi Christian,

There's not much penalty in Intel CPUs while SPARC does perform worse
with volatiles.  However, I cannot show you concrete numbers because I
don't have access to an idle SPARC machine at the moment.  Perhaps
someone could run some simple test and let us know?  I'm not sure if
there is a reliable methodology to measure the overhead of volatile
though.

— Trustin Lee, http://gleamynode.net/

On Mon, Nov 9, 2009 at 4:15 PM, Christian Migowski <chrismfwrd at gmail.com> wrote:
> 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
>>
>
> _______________________________________________
> 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