Skip to content

Conversation

wang384670111
Copy link

SeqCst is overly restrictive. I believe that the ordering can be appropriately modified.

COUNTER and NEXT_ID are used for multithreading counting purposes and don’t synchronize with other locals, so using Relaxed ordering is sufficient.

COUNTER.fetch_add(1, Ordering::SeqCst)

let next = NEXT_ID.fetch_add(1, Ordering::SeqCst).checked_add(1);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant