chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.8k stars 423 forks source link

Use more relaxed memory orders for reference counting #11853

Open ronawho opened 5 years ago

ronawho commented 5 years ago

ReferenceCount and RefCountBase currently use sequentially consistent atomics to implement reference counting, but this is stricter than is needed. There is a atomic_refcnt version that uses more relaxed operations. If possible we should unify our implementations and use more relaxed atomics. Here's an example implementation from boost

Related to https://github.com/chapel-lang/chapel/issues/11852

ronawho commented 5 years ago

There's another implementation of reference counting in the runtime (qio) that also uses seq_cst atomics.