softwaremill / jox

Fast and Scalable Channels in Java
Apache License 2.0
251 stars 8 forks source link

Could you use a LongAdder instead of AtomicLong #14

Closed StevenCurran closed 9 months ago

StevenCurran commented 10 months ago

Usually better if you have a high amount of CAS contention. Seems you are updating these values in busy loops, so may be a better approach.

adamw commented 10 months ago

Thanks, I'll try this out!

kaspernielsen commented 10 months ago

A LongAdder is primarily used for calculating sums. It would not be applicable in your case.

adamw commented 9 months ago

Closing b/c of above