RFR (XS): 8014890 : Reference queues may return more entries than expected
david.holmes at oracle.com
Fri Jul 5 05:58:32 UTC 2013
On 1/07/2013 9:44 PM, Aleksey Shipilev wrote:
> On 07/01/2013 03:37 PM, David Holmes wrote:
>> On 1/07/2013 8:14 PM, Aleksey Shipilev wrote:
>>> The same "thou shalt not do multiple volatile reads" applies to
>>> "(r.queue == NULL) || (r.queue == ENQUEUED)" now.
>> Doesn't that just reduce to "r.queue != this" ? (The assert suggests
>> so :) )
> Thomas' original patch had this in form of "r.queue != this". I argue it
> is more future-proof to distinguish the concrete cases.
Seems dubious to me - depends on what the future change would be. Here
and now it does two comparisons instead of one - which seems a micro
>>> Also, continuing on the micro-optimization spree, you might want to
>>> use bitwise |, not logical ||, saving a branch.
>> Bit-wise OR? What bits are you ORing ?
> You *can* bitwise OR two booleans; which would only remove
> short-circuiting behavior with the benefit of clearing one branch. See
How obscure :)
More information about the core-libs-dev