RFR: 8243326: Cleanup use of volatile in taskqueue code

Thomas Schatzl thomas.schatzl at oracle.com
Wed Apr 22 10:06:13 UTC 2020


Hi,

On 22.04.20 10:49, Kim Barrett wrote:
> Please review this change that eliminates most uses of the volatile
> qualifier in the taskqueue code.  The remaining uses are in the
> declarations of the queue's _bottom and _age members.  That's just our
> current style of tagging "atomic" variables manipulated by multiple
> threads.
> 

Some minor nits:

- although I understand it is quite old code, maybe change MOD_N_MASK to 
CamelCase in some way as it is a static const now. I am okay to ignore 
this remark.

- pre-existing: static-assert that N is a power of 2 otherwise the 
masking won't work.

- pre-existing: N should also be smaller than what is representable by 
idx_t.

- pre-existing: there are a few places/asserts where "N - 1" is used 
verbatim. Maybe exchange with that static above, however I'm not sure 
that unless it is named properly this is an improvement. Or have another 
constant for that. Or have a predicate/method for that always 
same-checking. Probably it's best to ignore this comment.

Looks good otherwise.

Thanks,
   Thomas



More information about the hotspot-gc-dev mailing list