[concurrency-interest] padding in Exchanger

Ruslan Cheremin cheremin at gmail.com
Tue Jan 17 10:53:24 EST 2012


> Yes. As a practical matter though, until an @Contended attribute
> or something like it is supported across JVMS (see list archives for
> discussion), you cannot arrange reliable two-sided padding
> for objects with mixed field types (ints, longs, refs that may be
> either 32 or 64 bits, etc), so one-sided is the best you can do.

By the way -- I was not thinking about @Contended as "make padding for
me". It seems for me like padding is only dirty hack, since nothing
better available. If I would control memory allocation (like JVM does)
I just can allocate @Contended objects on 64 (128... etc) bytes
boundary. I do not have to "pad" them -- nor both, nor one side. And I
suppose @Contended implementation to do exactly this -- "use special
allocator for objects of that type, which allocate them on cache line
boundary"

Am I wrong here?


>
> -Doug
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest


More information about the Concurrency-interest mailing list