Skip to content

Fine-tune the Ordering for num_senders #583

Description

@wang384670111

num_senders: AtomicUsize,

As mentioned in the comments, num_senders is used only for counting purposes, not for synchronizing access to other shared variables. While SeqCst guarantees the correctness of the program, it can also affect the performance. Therefore, using Relaxed is sufficient to maintain the correctness of the program without affecting its efficiency. Therefore, using Relaxed is sufficient to maintain the program's correctness without sacrificing its efficiency.

I don't think using SeqCst is good coding practice, and if it makes sense, I'd be happy to open a pr.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions